Class ErrorDispatcher
java.lang.Object
org.apache.jasper.compiler.ErrorDispatcher
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic JavacErrorDetailcreateJavacError(String fname, org.apache.jasper.compiler.Node.Nodes page, StringBuilder errMsgBuf, int lineNum) voidjavacError(String errorReport, Exception e) voidjavacError(JavacErrorDetail[] javacErrors) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidstatic 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.
-
Constructor Details
-
ErrorDispatcher
public ErrorDispatcher(boolean jspcMode)
-
-
Method Details
-
jspError
- Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
- 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
- Throws:
JasperException
-
jspError
- 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 prependje- The JasperException to amend- Throws:
JasperException
-
javacError
- Throws:
JasperException
-
javacError
- 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
-