You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Felipe Schnack <fe...@ritterdosreis.br> on 2002/09/20 00:15:44 UTC

error page

  Hi! I tried to find this in the archives with no luck...
  I'm starting to use standard and request taglibs, and would like to
convert a simple jsp with scriptlets to taglib-only. My problem is with
a very simple part of it. I developed a default error page for my
system, that is called when an unhandled error occurs (configured as the
error page for Throwable exceptions).
  So, how I convert this JSP to taglibs? CtlString.getStackText() is a
method that returns an exception's stack trace as a String.

Exception e =
(Exception)request.getAttribute("javax.servlet.jsp.jspException");
out.print(CtlString.getStackText(e));

  I should implement a taglib that just calls getStackText and get the
attribute from the HttpServletRequest?

-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: error page

Posted by Shawn Bayern <ba...@essentially.net>.
On 19 Sep 2002, Felipe Schnack wrote:

> My problem is with a very simple part of it. I developed a default
> error page for my system, that is called when an unhandled error
> occurs (configured as the error page for Throwable exceptions).
>   So, how I convert this JSP to taglibs? CtlString.getStackText() is a
> method that returns an exception's stack trace as a String.
> 
> Exception e =
> (Exception)request.getAttribute("javax.servlet.jsp.jspException");
> out.print(CtlString.getStackText(e));
> 
> I should implement a taglib that just calls getStackText and get the
> attribute from the HttpServletRequest?

Yes, if you'd like to avoid creating that scriptlet.  In JSP 2.0, you'd be
able to expose this as an "EL function," but that feature is still in the
future.

I'd just write a simple taglib that passes on the call; it should involve
only a few lines of code.

Hope that helps,

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>