Errorpage.jsp Sample

This topic inludes the source code for the Errorpage.jsp Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/handlingData/traditional_vs_pageFlow_webApp/traditional_webApp/

Sample Source Code


01 <%@ page language="java" contentType="text/html;charset=UTF-8"%>
02 <%@ page isErrorPage="true" %>
03 <html>
04 <body>
05 There was an error in the form you submitted.  The detailed error message is:
06 <blockquote>
07 <%= exception.getMessage() %>
08 <% ifexception.getClass().getName() != "java.lang.NumberFormatException") { %>
09   <pre>
10   <% java.io.StringWriter sWriter = new java.io.StringWriter();
11      java.io.PrintWriter pWriter = new java.io.PrintWriter(sWriter);
12      exception.printStackTrace(pWriter);
13      out.print(sWriter.toString()); %>
14   </pre>
15 <% %>
16 </blockquote>
17 </body>
18 </html>