Package org.apache.jasper.compiler
Class ErrorDispatcher
- java.lang.Object
-
- 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
Constructors Constructor Description ErrorDispatcher(boolean jspcMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JavacErrorDetailcreateJavacError(String fname, org.apache.jasper.compiler.Node.Nodes page, StringBuilder errMsgBuf, int lineNum)voidjavacError(String errorReport, Exception e)voidjavacError(JavacErrorDetail[] javacErrors)voidjspError(Exception e)voidjspError(String errCode)voidjspError(String errCode, String... args)voidjspError(String errCode, String arg, Exception e)voidjspError(org.apache.jasper.compiler.Mark where, Exception e)voidjspError(org.apache.jasper.compiler.Mark where, String errCode)voidjspError(org.apache.jasper.compiler.Mark where, String errCode, String... args)voidjspError(org.apache.jasper.compiler.Node n, String errCode)voidjspError(org.apache.jasper.compiler.Node n, String errCode, String... args)voidjspError(org.apache.jasper.compiler.Node n, String errCode, String arg, Exception e)static JavacErrorDetail[]parseJavacMessage(org.apache.jasper.compiler.Node.Nodes pageNodes, String errMsg, String fname)voidthrowException(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.
-
-
-
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 JasperExceptionCreates 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 prependje- 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(org.apache.jasper.compiler.Node.Nodes pageNodes, String errMsg, String fname) throws IOException, JasperException
- Throws:
IOExceptionJasperException
-
createJavacError
public static JavacErrorDetail createJavacError(String fname, org.apache.jasper.compiler.Node.Nodes page, StringBuilder errMsgBuf, int lineNum) throws JasperException
- Parameters:
fname-page-errMsgBuf-lineNum-- Returns:
- JavacErrorDetail The error details
- Throws:
JasperException
-
-