I have set up it as follows
  <bean id="exceptionResolver"

class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    <property name="exceptionMappings">
      <props>
        <prop key="java.lang.Exception">errorex</prop>
      </props>
    </property>
  </bean>

Where errorex is an entry in the view resolver as follows
<!-- Controller configuration Resolver (URL Mapping)-->
  <bean id="publicURLMapping"
    class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="interceptors">
      <list>
        <ref bean="requestResponseSnifferInterceptor" />
      </list>
    </property>
    <property name="mappings">
      <props>
        <prop key="/home">homeController</prop>
        <prop key="/rolemnt">roleMntController</prop>
        <prop key="/rolemntedit">roleMntEditController</prop>
        <prop key="/maillistmnt">mailListMntController</prop>
        <prop key="/maillistmntedit">mailListMntEditController</prop>
        <prop key="/mailinfodetailmnt">mailInfoDetailMntController</prop>
        <prop
key="/mailinfodetailfailedmnt">mailInfoDetailFailedMntController</prop>
        <prop
key="/mailinfodetailviewmnt">mailInfoDetailViewMntController</prop>
        <prop key="/usermnt">userMntController</prop>
        <prop key="/usermntedit">userMntEditController</prop>
        <prop key="/usermaillistmnt">userMailListMntController</prop>
        <prop key="/sendmailmnt">sendMailMntController</prop>
        <prop key="/errorex">errorExceptionController</prop>
      </props>
    </property>
  </bean>

So, I think it is well wired, don't you?

On 5/6/09, Matt Raible <m...@raibledesigns.com> wrote:
>
> Do you have things configured similar to the DataAccessException in
> dispatcher-servlet.xml?
>
>     <bean id="exceptionResolver"
> class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
>         <property name="exceptionMappings">
>             <props>
>                 <prop
> key="org.springframework.dao.DataAccessException">
>                     dataAccessFailure
>                 </prop>
>             </props>
>         </property>
>     </bean>
>
> On Wed, May 6, 2009 at 7:48 AM, Carlos Ortiz <theowlo2...@gmail.com>wrote:
>
>> But I don't actually know what is missing or getting to work as not
>> expected. There should be a tutorial or doc or something on this regard.
>>
>>
>> On Tue, May 5, 2009 at 11:29 AM, Matt Raible <m...@raibledesigns.com>wrote:
>>
>>> I don't know why your problem is occurring. It sounds like it should
>>> work.
>>>
>>> Matt
>>>
>>>
>>> On Tue, May 5, 2009 at 9:33 AM, Carlos Ortiz <theowlo2...@gmail.com>wrote:
>>>
>>>> Well, thanks. That is not what I want.
>>>> It is this what's happening?
>>>>
>>>> I try to upload a file.
>>>> The exception occurs and the Exception Resolver I implemented that traps
>>>> this one redirects to the page where the upload originated with a parameter
>>>> in the URL indicating that file is too big. Everything here is ok,. but
>>>> apparently the Servlet (tomcat) is receiving the 500 code and no 
>>>> redirection
>>>> is in effect. Thus, let me guess, do I need to configure a 500 code in
>>>> WEB.XML?
>>>>
>>>> On Mon, May 4, 2009 at 11:47 AM, Matt Raible <m...@raibledesigns.com>wrote:
>>>>
>>>>> What does your ExceptionResolver configuration look like? 500 error
>>>>> codes are generally handled by AppFuse's configuration in web.xml.
>>>>>
>>>>> Matt
>>>>>
>>>>>
>>>>> On Sun, May 3, 2009 at 10:10 PM, Carlos Ortiz 
>>>>> <theowlo2...@gmail.com>wrote:
>>>>>
>>>>>> Hi everyone
>>>>>>
>>>>>> I don't know if any of you have come across the following annoying
>>>>>> situation.
>>>>>> I am using Spring Framework 2.5.5 using Spring Web MVC and Spring
>>>>>> JDBC, using Eclipse WTP and Tomcat, but the feature I am trying to 
>>>>>> control
>>>>>> is the FileUpload process.
>>>>>> Well I have set everything to work with the Commons File upload
>>>>>> integration and everything is fine for uploading the file except when it 
>>>>>> is
>>>>>> time to control the exception handling MaxUploadSizeExceededException. I
>>>>>> implemented an Exception Resolver for this to redirect to my page and
>>>>>> telling the form that it was not valid, I have set a breakpoint and 
>>>>>> noticed
>>>>>> that Spring uses the class but no redirection is done, as the Servlet
>>>>>> container has trapped the HTTP error code 500.
>>>>>>
>>>>>> Searched google but found no solution to work.
>>>>>> Have anyone of you found a workaround to this very annoying problem?
>>>>>>
>>>>>> Thanks in advance
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Reply via email to