Results 1 to 2 of 2

Thread: Handling back end errors with controller

  1. #1
    Join Date
    Aug 2004
    Location
    Paris
    Posts
    43

    Default Handling back end errors with controller

    Hi, I would like to have your advices about handling back end (manager) errors in the controller to redirect error codes to the front.

    For now, my first guess will be to catch an exception from the manager, exception wich will implement the ErrorCoded interface, and then to pass the error code of the exception to the view through the Map build in referenceData.

    Let's share some coding experiences.

    Olivier

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    Take a look at SimpleMappingExceptionResolver. There's an example of it's uasge in the Petclinic sample.

    Code:
    	<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    		<property name="exceptionMappings">
    			<props>
    				<prop key="org.springframework.dao.DataAccessException">dataAccessFailure</prop>
    				<prop key="org.springframework.transaction.TransactionException">dataAccessFailure</prop>
    			</props>
    		</property>
    	</bean>

Similar Threads

  1. Replies: 5
    Last Post: Dec 6th, 2011, 01:11 PM
  2. Clear errors on back button
    By thus in forum Web
    Replies: 0
    Last Post: Oct 20th, 2005, 08:53 AM
  3. Replies: 1
    Last Post: Sep 20th, 2005, 09:14 PM
  4. proper wizard back button handling
    By chav in forum Web Flow
    Replies: 4
    Last Post: Sep 12th, 2005, 11:11 AM
  5. Handling Controller Exceptions in a JSP
    By KBThakur in forum Web
    Replies: 4
    Last Post: Jun 10th, 2005, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •