My opinion: Accept that you will have to add more Java code to your JSP and handle
the exception there. Though it further breaks down the "presentation" only concept
of JSP, I think it makes sense to handle exceptions where the methods are called.
To do anything real you've got to add tons of code to the JSP anyway (after all,
JSP is really a servlet disguised as an HTML file.) --Scott

Neal Kaiser wrote:

> I have a problem that I was hoping writing a custom tag would solve...
>
> I have a jsp page, which uses a bean. This bean can catch an exception, and
> use a RequestDispatcher.forward()
> to an ErrorHandler JSP.  Even though I have a return statement after the
> forward() in the bean, it returns control
> back to the original JSP (unlike a return statement in a JSP which returns
> from the service method). This follows the spec...but it also breaks my
> application. The ErrorHandler page is shown, but control continues back to
> the original JSP.
>
> Anyways, rather then setting attributes and checking for attributes (to
> detect if there was a forward to ErrorHandler) I thought I could write a
> custom <abort> tag which would stop the control by returning SKIP_PAGE from
> the doEndTag() method....
>
> This does stop any content after the <abort> tag on the ErrorHandler.jsp
> page, however, just like the bean, it returns control back to the first JSP
> that was called. Is this per spec?  Am I out of luck with a clean solution
> to this?
>
> Thanks,
> Neal
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to