操作步骤:
1. 在<action name>中填加如下信息, interceptor可以在struct的struct-default文件中找到, fileupad的参数可以在struct类中FileUploadInterceptor找到参数说明
<interceptor-ref name="fileupload">
<param name="allowedTypes">image/bmp,image/png</param>
<param name="maximumSize>102400</param>
2. 引用默认拦截器栈,如果不引用, 则ActionSupport的值无效
<interceptor-ref name="defaultStack"/>
3. action类必须要继续ActionSupport
public class BookAddAction extends ActionSupport{}
4. 接收错误信息的返回值
<result name="input">/error/fileuploaderror.jsp</resutl>
5. 用JSP页面显示错误信息
<%@ taglib uri="/structs-tags" profix="s"%>
使用 <s:fielderror>输出错误信息