1.web.xml加载struts框架即过滤器,要注意struts版本不同过滤器配置也不同。

 1 <!DOCTYPE web-app PUBLIC
 2         "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 3         "http://java.sun.com/dtd/web-app_2_3.dtd" >
 4 
 5 <web-app>
 6   <display-name>Archetype Created Web Application</display-name>
 7 
 8   <filter>
 9     <filter-name>struts2</filter-name>
10 
11     <filter-class>
12       org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
13     </filter-class>
14 
15     <init-param>
16       <param-name>config</param-name>
17       <param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value>
18     </init-param>
19   </filter>
20 
21       <filter-mapping>
22         <filter-name>struts2</filter-name>
23         <url-pattern>/*</url-pattern>
24       </filter-mapping>
25 
26   <welcome-file-list>
27     <welcome-file>login.jsp</welcome-file>
28   </welcome-file-list>
29 
30 </web-app>
View Code

相关文章:

  • 2021-08-17
  • 2021-12-17
  • 2021-10-12
  • 2021-12-14
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2021-12-31
  • 2021-09-04
  • 2022-12-23
相关资源
相似解决方案