Thanks for the response. What I'd like to do is allow an action to handle the JSP exception instead of a JSP, so that I can save the exception to the DB and then redirect the user to an error page. The problem I am having is trying to get the exception object to pass to the action. This is what I was trying to use (web.xml):
<error-page> <exception-type>java.lang.Exception</exception-type> <location>/canvas.action</location> </error-page> > Date: Thu, 22 Jan 2009 11:19:35 +0000 > From: ahardy.str...@cyberspaceroad.com > To: user@struts.apache.org > Subject: Re: Handling JSP exceptions in Struts2 > > Andy on 20/01/09 17:49, wrote: > > Using the Exception interceptor works great for catching exceptions throw by > > actions. However I am wondering what is the recommended method for catching > > and handling exceptions thrown by a JSP? I assume that JSP exceptions are > > outside the S2 scope and are to be handled at the container level? > > Assumption correct. > > Your situation might be quite simple if you have a basic JSP. Put in an error > declaration > > <%@ page errorPage="/WEB-INF/jsp/error.jsp" %> > > and handle it there. > > If you're using multiple JSPs with a templating system like tiles, it gets > more > complicated. I do and I put a meta-redirect in my error JSP so that the > browser > doesn't show the mix of correct and broken fragments. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _________________________________________________________________ Windows Liveā¢: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009