<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.actioncontextcleanup
</filter-class>
</filter>
<filter-mapping>
<url-pattern>/*</url-pattern>
</filter-mapping>
該filter清除緩存。在做上傳檔案時,要在web.xml中增加actioncontextcleanup這個filter,否則會發生第一次上傳取不到檔案的情況。
原帖位址:http://blog.sina.com.cn/s/blog_5bd6b45101012i74.html