I am developing with Struts 2 and using global-exception-mappings in the struts config file to handle all HibernateOptimisticLockingFailureException exceptions that occur. I am also setting result="input" in order to render back to the same screen instead of a global error screen.
<global-exception-mappings>
<exception-mapping exception="org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException" result="input"/>
</global-exception-mappings>
This works correctly, but now I need to figure out how to set a customized error message when HibernateOptimisticLockingFailureException occurs which be displayed near the top of the screen. In addition, I need to be able to set custom error messages for each type of exception that is handled in the struts.xml file.
Are there any suggestions on how this could be done?
<global-exception-mappings>
<exception-mapping exception="org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException" result="input"/>
</global-exception-mappings>
This works correctly, but now I need to figure out how to set a customized error message when HibernateOptimisticLockingFailureException occurs which be displayed near the top of the screen. In addition, I need to be able to set custom error messages for each type of exception that is handled in the struts.xml file.
Are there any suggestions on how this could be done?