Announcement Announcement Module
No announcement yet.
Page cannot be displayed while trying to upload a file Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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">

    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

    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">
    <prop key="java.lang.Exception">WEB-INF/60/jsp/error.jsp</prop>

    How do we handle this exception ?

    Any helps are appreciated.