Runtime components : Presentation components : JSPs : Tasks : Displaying an HTML error page from a JSP
  
Displaying an HTML error page from a JSP
If your application does not handle an exception that prevents further processing, the toolkit uses the default errorPage specified in the configuration file. A JSP can get the exception to display the message by doing a request.getAttribute("exception") or by calling the getExceptionMessage method in com.ibm.btt.cs.html.DSEJspContextServices. This method gets the locale from the dse_locale attribute to retrieve the appropriate localized message and build the dynamic part of the message, as in the following example:
<%
// Obtain the operation context from the request
Exception e = (Exception)request.getAttribute ("dse_exception");
out.println ("An exception occurred which prevents further processing.");
out.println (utb.getExceptionMessage());
out.println ("<br><br>"+e.toString());
%>
See errorpage.jsp in the HTML Sample Application for an example.
Go up to
Tasks