Stack trace ALL exceptions from JasperException?

Java

Hi,

Developers who write JSP will face this problem. They will end up with a JasperException, they have to pull their hairs to find the actual reason, either by try-catch block or any other way. if you have used jsp usebean tag, thats end. you have to put traces inside the bean. So, we need a way to get the exact exception that was probagated. So here is the way.

if( e instanceof ServletException ) {
pw.println( "Root cause:" );
( (ServletException) e ).getRootCause().printStackTrace( sw );

}

yes. this will solve your problem. ofcourse, if we put this code inside errorPage, that will be very helpful for us to track the exceptions.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s