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.
Constructor and Description |
---|
ErrorDispatcher(boolean jspcMode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static JavacErrorDetail |
createJavacError(String fname,
Node.Nodes page,
StringBuffer errMsgBuf,
int lineNum) |
static JavacErrorDetail |
createJavacError(String fname,
Node.Nodes page,
StringBuffer errMsgBuf,
int lineNum,
JspCompilationContext ctxt) |
void |
javacError(JavacErrorDetail[] javacErrors)
Dispatches the given javac compilation errors to the configured error
handler.
|
void |
javacError(String errorReport,
Exception e)
Dispatches the given compilation error report and exception to the
configured error handler.
|
void |
jspError(Exception e)
Dispatches the given parsing exception to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Mark where,
String errCode)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Mark where,
String errCode,
String arg)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Mark where,
String errCode,
String arg1,
String arg2)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Mark where,
String errCode,
String arg1,
String arg2,
String arg3)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Node n,
String errCode)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Node n,
String errCode,
String arg)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Node n,
String errCode,
String arg,
Exception e)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Node n,
String errCode,
String arg1,
String arg2)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(org.apache.struts2.jasper.compiler.Node n,
String errCode,
String arg1,
String arg2,
String arg3)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(String errCode)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(String errCode,
String arg)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(String errCode,
String arg,
Exception e)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(String errCode,
String arg1,
String arg2)
Dispatches the given JSP parse error to the configured error handler.
|
void |
jspError(String errCode,
String arg1,
String arg2,
String arg3)
Dispatches the given JSP parse error to the configured error handler.
|
static JavacErrorDetail[] |
parseJavacErrors(String errMsg,
String fname,
Node.Nodes page)
Parses the given error message into an array of javac compilation error
messages (one per javac compilation error line number).
|
public ErrorDispatcher(boolean jspcMode)
jspcMode
- true if compilation has been initiated by JspC, false otherwisepublic void jspError(String errCode) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
errCode
- Error codeJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Mark where, String errCode) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
where
- Error locationerrCode
- Error codeJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Node n, String errCode) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
n
- Node that caused the errorerrCode
- Error codeJasperException
- in case of Jasper errorspublic void jspError(String errCode, String arg) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
errCode
- Error codearg
- Argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Mark where, String errCode, String arg) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
where
- Error locationerrCode
- Error codearg
- Argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Node n, String errCode, String arg) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
n
- Node that caused the errorerrCode
- Error codearg
- Argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(String errCode, String arg1, String arg2) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
errCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(String errCode, String arg1, String arg2, String arg3) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
errCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementarg3
- Third argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Mark where, String errCode, String arg1, String arg2) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
where
- Error locationerrCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Mark where, String errCode, String arg1, String arg2, String arg3) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
where
- Error locationerrCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementarg3
- Third argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Node n, String errCode, String arg1, String arg2) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
n
- Node that caused the errorerrCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Node n, String errCode, String arg1, String arg2, String arg3) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
n
- Node that caused the errorerrCode
- Error codearg1
- First argument for parametric replacementarg2
- Second argument for parametric replacementarg3
- Third argument for parametric replacementJasperException
- in case of Jasper errorspublic void jspError(Exception e) throws JasperException
Dispatches the given parsing exception to the configured error handler.
e
- Parsing exceptionJasperException
- in case of Jasper errorspublic void jspError(String errCode, String arg, Exception e) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
errCode
- Error codearg
- Argument for parametric replacemente
- Parsing exceptionJasperException
- in case of Jasper errorspublic void jspError(org.apache.struts2.jasper.compiler.Node n, String errCode, String arg, Exception e) throws JasperException
Dispatches the given JSP parse error to the configured error handler.
The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message.
n
- Node that caused the errorerrCode
- Error codearg
- Argument for parametric replacemente
- Parsing exceptionJasperException
- in case of Jasper errorspublic static JavacErrorDetail[] parseJavacErrors(String errMsg, String fname, Node.Nodes page) throws JasperException, IOException
Parses the given error message into an array of javac compilation error messages (one per javac compilation error line number).
errMsg
- Error messagefname
- Name of Java source file whose compilation failedpage
- Node representation of JSP page from which the Java source
file was generatedJasperException
- in case of Jasper errorsIOException
- in case of IO errorspublic void javacError(JavacErrorDetail[] javacErrors) throws JasperException
Dispatches the given javac compilation errors to the configured error handler.
javacErrors
- Array of javac compilation errorsJasperException
- in case of Jasper errorspublic void javacError(String errorReport, Exception e) throws JasperException
Dispatches the given compilation error report and exception to the configured error handler.
errorReport
- Compilation error reporte
- Compilation exceptionJasperException
- in case of Jasper errorspublic static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum) throws JasperException
fname
- Name of the JSP file in which the parse error occurredpage
- pageerrMsgBuf
- error message bufferlineNum
- line numberJasperException
- in case of Jasper errorspublic static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum, JspCompilationContext ctxt) throws JasperException
fname
- Name of the JSP file in which the parse error occurredpage
- pageerrMsgBuf
- error message bufferlineNum
- line numberctxt
- JSP compilation contextJasperException
- in case of Jasper errorsCopyright © 2000–2020 Apache Software Foundation. All rights reserved.