JSP QnA

9329 ±è¸í¼·
2010-03-10 18:04:40
struts2 ¿¡·¯Ã³¸®¹æ¹ý

¸ÕÀú ¼³Á¤À» º¸½ÃÁÒ.

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¿¡ ÁöÁ¤ÇÑ ÆäÀÌÁö·Î À̵¿ÇؾßÇϴµ¥
½Ã½ºÅÛ ¿¡·¯ÆäÀÌÁö·Î °©´Ï´Ù.

¹¹°¡ ¹®Á¦Àΰ¡¿ä?

 


 

Tag
tag´Â °Ô½Ã¹°ÀÇ ¼º°ÝÀ» ³ªÅ¸³»´Â Ű¿öµå¸¦ ÀÔ·ÂÇÏ´Â °ø°£ÀÔ´Ï´Ù.
tag´Â ·Î±×ÀÎ ÈÄ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.
  • tiles.test.Error ·Î ¸ÊÇεǴ ºÎºÐÀÌ ¾îµò°¡¿ä?
  • 6215¤·¤·
  • 2010-03-10 18:08:04
  • x
  • tiles.xml¿¡ ¼³Á¤Çسù´Âµ¥...
    /error/Error.jsp
    °¡ µË´Ï´Ù.
  • 9329kms5969
  • 2010-03-10 18:11:17
  • x
  • <exception-mapping exception="java.lang.Exception" result="error"/>
    <exception-mapping exception="java.lang.Error" result="error"/>
    <exception-mapping exception="java.lang.Throwable" result="error"/>

    3°³´Ù ÇØÁຸ¼¼¿ë.~
  • 6215¤·¤·
  • 2010-03-10 19:32:16
  • x
´ÙÀ½±Û quartz ÇϳªÀÇ job¿¡ ¾î·¯°³ÀÇ trigger
>> 53878 struts2 ¿¡·¯Ã³¸®¹æ¹ý  [3] ±è¸í¼· 1586 2010-03-10 18:04:40
ÀÌÀü±Û weblogic ¿¡¼­ Äֿܼ¡¼­ ¼ÂÆÃÇÏ·Á°í ÇÏ´Ï ÀÌ·±¿¡·¯°¡..¿øÀÎÀÌ ¹ºÁö??