Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

global exception handling - struts sometimes ignores my setting in
struts-config, what's wrong?

Marek Cupak

2007-08-13

Replies:


i need to configure struts to display user a errpage.jsp, when runtime
exception CustomException occur anywhere in the application. i've added to
struts-config:

<global-exceptions>
 <exception  key="exception.Exception"
     type="somepackage.CustomException"
     path="/ErrorPage.jsp"/>
</global-exceptions>

and to web.xml:

<error-page>
   <error-code>500</error-code>
 <location>/ErrorPage.jsp</location>
</error-page>

when i browse page _spikeScriptletThrowingEx.jsp:

<%@(protected)"
pageEncoding="UTF-8"%>
<html>
 <head>
   <title></title>
 </head>
 <body>
   <% throw new Exception(); %>
 </body>
</html>

i receive only "The website cannot display the page, HTTP 500...". why is
the ErrorPage.jsp not displayed?

--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.