0

I am using struts2 for file uploading .When the file size exceeds configured length it is giving

org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:

How i can show in my form page this error.Because it is raising in interceptor.

4

1 回答 1

0

为您的 Action定义一个input结果,指向该success结果的同一个 JSP。

在 JSP 中,检查 actionErrors 或 fieldErrors,如果有则打印它们,例如:

<s:if test="actionErrors != null && actionErrors.size > 0">
    <div class="feed_ko">
        <s:actionerror escape="false" />
    </div>
</s:if>
<s:if test="fieldErrors != null && fieldErrors.size > 0">
    <div class="feed_ko">
        <s:fielderror />
    </div>
</s:if>
于 2013-09-05T10:29:31.343 回答