¸ÕÀú ¼³Á¤À» º¸½ÃÁÒ.
struts.xml
....
<global-results>
<result name="error" type="tiles">tiles.test.Error</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="error" exception="java.lang.Exception"/>
</global-exception-mappings>
....
web.xml
....
<error-page>
<error-code>404</error-code>
<location>/error/Error404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error/Error500.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/error/Error.jsp</location>
</error-page>
....
ÀÌ·¸°Ô ¼³Á¤À» Çß½À´Ï´Ù.
ÀǵµÀûÀÎ ¿¹¿Ü(throw new Exception();) ¶Ç´Â
ÀǵµÀûÀÎ ¿¡·¯(return ERROR;)ÀÇ °æ¿ì´Â struts.xml¿¡ ÁöÁ¤ÇÑ ¿¡·¯ÆäÀÌÁö·Î (/error/error.jsp)°©´Ï´Ù.
±×·±µ¥... ¾Æ·¡ ÁÖ¼Ò¸¦ º¸¸é..
Á¤»óÁÖ¼Ò : http://localhost/test/test.action
ºñÁ¤»óÁÖ¼Ò1 : http://localhost/test/tes.action(500¿¡·¯)
ºñÁ¤»óÁÖ¼Ò2 : http://localhost/test/test.actio(404¿¡·¯)
ºñÁ¤»óÁÖ¼Ò1, ºñÁ¤»óÁÖ¼Ò2¸¦ ÀÔ·ÂÀ» ÇßÀ» °æ¿ì
web.xml¿¡ ÁöÁ¤ÇÑ ÆäÀÌÁö·Î À̵¿ÇؾßÇϴµ¥
½Ã½ºÅÛ ¿¡·¯ÆäÀÌÁö·Î °©´Ï´Ù.
¹¹°¡ ¹®Á¦Àΰ¡¿ä?