关于strtus2过滤器问题

alison-c 项目经理  2015-11-05 11:37:58

问题:请求 *.action文件,都报http 404错误,为什么呢?
(1)web.xml的过滤器配置(部分),前面是spring security3 过滤器,后边是struts2的过滤器
<!-- SpringSecurity过滤器。 -->

<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> -->
<!-- <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> -->
<!-- Struts2拦截器。 -->

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.jeaw</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
(2) 这是springSecurity配置applicationContext-security.xml(部分)
<!-- ======================springSecurity过虑链配置开始===================== -->
<bean id="springSecurityFilterChain" class="org.springframework.web.filter.DelegatingFilterProxy">
<property name="targetBeanName" value="filterChainProxy" />
</bean>

<bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy">
<s:filter-chain-map path-type="ant">
<s:filter-chain pattern="/" filters="none" />
<s:filter-chain pattern="/app/common/**" filters="none" />
<s:filter-chain pattern="/mySSOLogin" filters="none" />
<s:filter-chain pattern="/app/errors/**" filters="none" />
<s:filter-chain pattern="/app/welcome.jsp" filters="none" />
<s:filter-chain pattern="/app/login.jsp" filters="none" />
<s:filter-chain pattern="/components/**" filters="none" />
<s:filter-chain pattern="/css/**" filters="none" />
<s:filter-chain pattern="/images/**" filters="none" />
<s:filter-chain pattern="/js/**" filters="none" />
<s:filter-chain pattern="/*.css" filters="none" />
<s:filter-chain pattern="/*.jpeg" filters="none" />
<s:filter-chain pattern="/*.jpg" filters="none" />
<s:filter-chain pattern="/*.gif" filters="none" />
<s:filter-chain pattern="/*.png" filters="none" />
<s:filter-chain pattern="/*.js" filters="none" />
<s:filter-chain pattern="/security/captcha" filters="none" />
<s:filter-chain pattern="/dwr/**" filters="none" />
<s:filter-chain pattern="/**" filters="
concurrentSessionFilter,
securityContextPersistenceFilter,
logoutFilter,
authenticationProcessingFilter,
requestCacheAwareFilter,
securityContextHolderAwareRequestFilter,
sessionManagementFilter,
loginCallbackFilter,
exceptionTranslationFilter" />
</s:filter-chain-map>
</bean>
...全文
47 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-11-05 11:37
社区公告
暂无公告