You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shyam A <st...@yahoo.com> on 2004/01/29 21:47:29 UTC
Unable to redirect to error page in declarative Exception handling
Hi,
I use declarative Exception handling for my Struts
application in 2 places - struts-config.xml and
web.xml.
I use the following in my Struts-config.xml:
##############################################
<global-exceptions>
<exception
key="error.exception"
type="java.lang.Exception"
handler="dsap.application.action.DsapExceptionHandler"
path="/error.jsp"/>
</global-exceptions>
###############################################
In my Exception Handler class, I use -
return new ActionForward(ae.getPath()) to redirect to
the error page.
Also,I have an error page defined in my web.xml
as follows:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
The error page, error.jsp is directly under the
application directory like the other JSPs.
However, my application is not redirected to the error
page - "error.jsp", when there is an Exception like
NullPointerException.
Could somebody tell me what I'm doing wrong.
Any help would be greatly appreciated.
Thanks,
Shyam
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org