如何在Struts 2中处理自定义拦截器异常?
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
the request was rejected because its size (337867) exceeds the configured
maximum (200)
答案 0 :(得分:2)
将此常量设置为增加请求限制
<constant name="struts.multipart.maxSize" value="1000000" />
请记住,struts.multipart.maxSize是整个请求的大小限制,这意味着当您上传多个文件时,它们的大小总和必须低于struts.multipart.maxSize!
答案 1 :(得分:0)
<global-exception-mappings>
<exception-mapping exception="java.lang.NullPointerException" result="npe"/>
</global-exception-mappings>