handle runtime error from other classes and display in JSP

M

Matt

Should I catch exception in jsp page? or we can just put the following
in jsp page that can throw error.
<%@ page errorPage="errorpage.jsp" %>

In other words, should I put something like that in JSP page?

try
{
//etc...
}
catch(IOException e)
{ e.printStackTrace();
}
catch(Exception e)
{ e.printStackTrace();
}

My JSP page has method calls to other classes, and when exception is thrown from
other classes, I should display the message in JSP page, not the stack trace.

any suggestions? thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top