webwork.propertites
webwork.multipart.parser=jakarta
xwork.xml
<package name="default" extends="webwork-default">
<interceptors>
<interceptor name="upload"
class="com.opensymphony.webwork.interceptor.FileUploadInterceptor">
</interceptor>
<interceptor-stack name="uploadStack">
<interceptor-ref name="upload"></interceptor-ref>
<interceptor-ref name="basicStack"></interceptor-ref>
</interceptor-stack>
</interceptors>
<action name="fileUploadTest"
class="com.fileupload.action.FileUploadAction">
<interceptor-ref name="uploadStack"></interceptor-ref>
</action>
</package>
web.xml
<servlet>
<servlet-name>webwork</servlet-name>
<servlet-class>
com.opensymphony.webwork.dispatcher.ServletDispatcher
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>webwork</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
fileupload.jsp
<form action="fileUploadTest.action" method="post" enctype="multipart/form-data">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="file" name="files">
<input type="submit" value="上传">
</form>