这是我最近给某项目架构时使用的struts2.0 Web.xml配置.
就象huwangvs说的那样.
是用手工配置的.
使用的是myeclipse 5.X.
因为struts2中自带过滤器不是很好用(会过滤掉自己的一些法类(如ajax的上传等)),所以自己重写了个过滤器,主要用来做权限控制.
希望可以给你作为参考!
<welcome-file-list>
<welcome-file>sendIndex.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>com.wyq.filter.BaseFilter</filter-class>
<!-- -->
<init-param>
<param-name>logonStrings</param-name>
<param-value>login.jsp;login.action</param-value>
</init-param>
<init-param>
<param-name>includeStrings</param-name>
<param-value>.jsp;.html;.action;.struts;.wyq</param-value>
</init-param>
<init-param>
<param-name>redirectPath</param-name>
<param-value>/main/login.jsp</param-value>
</init-param>
<init-param>
<param-name>disableFilter</param-name>
<param-value>N</param-value>
</init-param>
</filter>
<!--<filter>
<filter-name>changeDatabase</filter-name>
<filter-class>com.wyq.filter.ChangeDataBaseFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>changeDatabase</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>