handle runtime error from other classes and display in JSP

From: Matt (jrefactors_at_hotmail.com)
Date: 06/30/04


Date: 29 Jun 2004 17:05:57 -0700

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!!



Relevant Pages

  • Stack trace ALL exceptions?
    ... In my code, when I catch an exception and print the stack trace, it ... Yet when I just do exception.printStackTrace in the JSP code, ... StringWriter sw = new StringWriter; ...
    (comp.lang.java.programmer)
  • Re: CSWS_JAVA v2.1 - Tomcat v4.1.24 - update/upgrade Tomcat?
    ... >>error when deployed to my Tomcat installation on OpenVMS. ... type Exception report ... Unable to compile class for JSP ...
    (comp.os.vms)
  • exception in JSP- need help!
    ... While running my JSP page, I am getting an exception.Im giving the full ... stack trace here.. ... >>From this exception, can anybody tell me what kind of error im getting? ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Problem mit JavaMail
    ... ich möchte aus einer JSP eine E-Mail versenden. ... Der Aufruf des Servlets erfolgt in folgender JSP: ... @exception IOException thrown if there is an input or output ... public static void send (String to, String from, String subject, ...
    (de.comp.lang.java)
  • Re: [LoWNOISE] Tomcat 3.2.1 ..0 DoS (WinNT)
    ... I have been entirely unable to replicate the DOS portion of the ... In a Java Server Pages system, the JSP files are compiled into Java ... exception that was thrown, and a stack-trace. ... JSP source and a description of the compilation error. ...
    (Bugtraq)