tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Padhu Vinirs <p.pa...@verizon.net>
Subject Re: How to catch the thrown Exception
Date Wed, 09 Oct 2002 20:12:21 GMT

If the exception is thrown from a Servlet, then catch the Exception, 
wrap it with a ServletException, throw this. Then you can retrieve the 
exception from attribute  javax.servlet.error.exception, and get the 
root cause exception.

yourException = 
request.getAttribute("javax.servlet.error.exception").getRootCause();

-- padhu



Nagpal, Vikas wrote:

>Hello Everybody,
>
>I have been trying to catch the thrown exception and print it on my JSP
>page. As I catch the exception and print it using System.out.println command
>it displays NULL. But I want to print the number which threw the exception
>not NULL. Can anyone tell me how to catch this number and print it on my JSP
>page.
>
>Thanks,
>Vikas nagpal.
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>
>
>  
>



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message