struts2的struts-cleanup

strtus2要在web.xml里面配置这一项作用:

清除缓存,帮我们进行清理
在做上传文件的时候,要在web.xml中增加ActionContextCleanUp这个filter,如果不增加,会发生第一次上传取不到文件的情况。

 1 <filter>
 2 <filter-name>struts-cleanup</filter-name>
 3 <filter-class>
 4 org.apache.struts2.dispatcher.ActionContextCleanUp
 5 </filter-class>
 6 </filter>
 7 <filter-mapping>
 8 <filter-name>struts-cleanup</filter-name>
 9 <url-pattern>/*</url-pattern>
10 </filter-mapping>
View Code
原文地址:https://www.cnblogs.com/dobestself-994395/p/4277291.html