Announcement Announcement Module
Collapse
No announcement yet.
Handling back end errors with controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment

    Working...
    X