When logic for exception handling is defined in struts-config.xml or within the action tag, it’s known as declarative exception handling in Struts. In the following example, we have defined exception in struts-config.xml file for NullPointerException:
<global-exceptions>
<exception key="test.key" Type="java.lang.NullPointerException"
Path="/WEB-INF/errors/error_page.jsp" />
</global-exceptions>
Posted in: