-
Oct 27th, 2005, 02:04 PM
#1
Page cannot be displayed while trying to upload a file
In FileUpload, I defined the maxUploadSize as following in xml:
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.C ommonsMultipartResolver">
<!-- one of the properties available; the maximum file size in bytes -->
<property name="maxUploadSize">
<value>100000</value>
</property>
</bean>
When I upload a file which is larger than the maxUploadSize, it goes to 'Page cannot be displayed' page with following errors in the log.
[org.springframework.web.servlet.DispatcherServlet] - <Handler execution resulted in exception - forwarding to resolved error view>
org.springframework.web.multipart.MaxUploadSizeExc eededException: Maximum upload size of 100000 bytes exceeded
at org.springframework.web.multipart.commons.CommonsM ultipartResolver.resolveMultipart(CommonsMultipart Resolver.java:247)
Even though I defined exceptionResolver, it doesn't seem to hit there before the error shows up.
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="java.lang.Exception">WEB-INF/60/jsp/error.jsp</prop>
</props>
</property>
</bean>
How do we handle this exception ?
Any helps are appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules