Announcement Announcement Module
Collapse
No announcement yet.
Handling exceptions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling exceptions

    Hello,

    I would like to handle constraint violations, when the user delete a registry that is referenced by a foreign key.

    What is the best way to do this. I would like to use something like "uncaughtException.jspx" but specific to this.

    I guess this is very simple, but if anyone can help?

  • #2
    this might be a good start point: How to check, throw and catch bean's validation ConstraintViolationException

    Comment


    • #3
      I am looking for something that does not include DAO, and that it's more Spring framework like.

      I am trying something like this on webmvc-config.xml:

      <bean class="org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver" p:defaultErrorView="uncaughtException">
      <property name="exceptionMappings">
      <props>
      <prop key=".ConstraintViolationException">constraintViol ation</prop>
      <prop key=".DataAccessException">dataAccessFailure</prop>
      <prop key=".NoSuchRequestHandlingMethodException">resour ceNotFound</prop>
      <prop key=".TypeMismatchException">resourceNotFound</prop>
      <prop key=".MissingServletRequestParameterException">res ourceNotFound</prop>

      </props>
      </property>
      </bean>


      But the exception is not caught !!

      Comment

      Working...
      X