日期:2014-05-17 浏览次数:20913 次
<filter-mapping> <filter-name>struts2 </filter-name> <url-pattern>/* </url-pattern> <dispatcher>REQUEST </dispatcher> <dispatcher>FORWARD </dispatcher>
------解决方案--------------------
struts2 还没用过。。。。。 多讨论一些,我也学习一下。
------解决方案--------------------
<!-- Setting UrlRewriteFilter --> <filter> <filter-name>UrlRewriteFilter</filter-name> <filter-class> org.tuckey.web.filters.urlrewrite.UrlRewriteFilter </filter-class> </filter> <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <!-- 定义整合SiteMesh必须的ActionContextCleanUp Filter --> <filter> <filter-name>struts-cleanup</filter-name> <filter-class> org.apache.struts2.dispatcher.ActionContextCleanUp </filter-class> </filter> <filter-mapping> <filter-name>struts-cleanup</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <!-- 定义整合SiteMesh和核心 Filter --> <filter> <filter-name>sitemesh</filter-name> <filter-class> com.opensymphony.module.sitemesh.filter.PageFilter </filter-class> </filter> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <!-- 定义Struts2的FilterDispathcer的Filter --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <!-- FilterDispatcher用来初始化struts2并且处理所有的WEB请求。 --> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <!-- 用于初始化Spring容器的Listener --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>