When an unhandled exception is throws (e.g. a RuntimeException
), then I want to show a common error page.
I want to achieve a few things:
- reuse a HTML template (use a common "frame" with header etc.) and place exception info in the body
- provide some basic info about the exception in the body document
I am using Apache Tiles and Spring MVC. What is a good approach to my problem?
Part of my tiles-definitions:
<tiles-definitions>
<definition name="common" template="/WEB-INF/jsp/common.jsp">
<put-attribute name="header" value="header"/>
<put-attribute name="footer" value="/WEB-INF/jsp/footer.jsp"/>
</definition>
...
<definition name="main" extends="common">
<put-attribute name="body" value="/WEB-INF/jsp/main.jsp"/>
</definition>
</tiles-definitions>
Ideally I'd like to specify a definition for an exception page by setting the body
attribute...