org.apache.jasper.compiler
Class ErrorDispatcher

java.lang.Object
  extended by org.apache.jasper.compiler.ErrorDispatcher

public class ErrorDispatcher
extends Object

Class responsible for dispatching JSP parse and javac compilation errors to the configured error handler. This class is also responsible for localizing any error codes before they are passed on to the configured error handler. In the case of a Java compilation error, the compiler error message is parsed into an array of JavacErrorDetail instances, which is passed on to the configured error handler.

Author:
Jan Luehe, Kin-man Chung

Constructor Summary
ErrorDispatcher(boolean jspcMode)
           
 
Method Summary
static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum)
           
 void javacError(JavacErrorDetail[] javacErrors)
           
 void javacError(String errorReport, Exception e)
           
 void jspError(Exception e)
           
 void jspError(org.apache.jasper.compiler.Mark where, Exception e)
           
 void jspError(org.apache.jasper.compiler.Mark where, String errCode)
           
 void jspError(org.apache.jasper.compiler.Mark where, String errCode, String... args)
           
 void jspError(org.apache.jasper.compiler.Node n, String errCode)
           
 void jspError(org.apache.jasper.compiler.Node n, String errCode, String... args)
           
 void jspError(org.apache.jasper.compiler.Node n, String errCode, String arg, Exception e)
           
 void jspError(String errCode)
           
 void jspError(String errCode, String... args)
           
 void jspError(String errCode, String arg, Exception e)
           
static JavacErrorDetail[] parseJavacMessage(Node.Nodes pageNodes, String errMsg, String fname)
           
 void throwException(org.apache.jasper.compiler.Mark where, JasperException je)
          Creates and throws a new exception from the given JasperException, by prepending the given location information (containing file name, line number, and column number) to the message of the given exception, and copying the stacktrace of the given exception to the new exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorDispatcher

public ErrorDispatcher(boolean jspcMode)
Method Detail

jspError

public void jspError(String errCode)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Mark where,
                     String errCode)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Mark where,
                     Exception e)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Node n,
                     String errCode)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(String errCode,
                     String... args)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Mark where,
                     String errCode,
                     String... args)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Node n,
                     String errCode,
                     String... args)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(Exception e)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(String errCode,
                     String arg,
                     Exception e)
              throws JasperException
Throws:
JasperException

jspError

public void jspError(org.apache.jasper.compiler.Node n,
                     String errCode,
                     String arg,
                     Exception e)
              throws JasperException
Throws:
JasperException

throwException

public void throwException(org.apache.jasper.compiler.Mark where,
                           JasperException je)
                    throws JasperException
Creates and throws a new exception from the given JasperException, by prepending the given location information (containing file name, line number, and column number) to the message of the given exception, and copying the stacktrace of the given exception to the new exception.

Parameters:
where - The location information (containing file name, line number, and column number) to prepend
je - The JasperException to amend
Throws:
JasperException

javacError

public void javacError(JavacErrorDetail[] javacErrors)
                throws JasperException
Throws:
JasperException

javacError

public void javacError(String errorReport,
                       Exception e)
                throws JasperException
Throws:
JasperException

parseJavacMessage

public static JavacErrorDetail[] parseJavacMessage(Node.Nodes pageNodes,
                                                   String errMsg,
                                                   String fname)
                                            throws IOException,
                                                   JasperException
Throws:
IOException
JasperException

createJavacError

public static JavacErrorDetail createJavacError(String fname,
                                                Node.Nodes page,
                                                StringBuffer errMsgBuf,
                                                int lineNum)
                                         throws JasperException
Parameters:
fname -
page -
errMsgBuf -
lineNum -
Returns:
JavacErrorDetail The error details
Throws:
JasperException


Copyright © 2007 Mort Bay Consulting. All Rights Reserved.