ErrorDispatcher (Apache Tomcat 7.0.76 API Documentation)

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 and Description
    `ErrorDispatcher(boolean jspcMode)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JavacErrorDetail` | `createJavacError(String fname, Node.Nodes page, StringBuilder errMsgBuf, int lineNum)`
    `static JavacErrorDetail` | `createJavacError(String fname, Node.Nodes page, StringBuilder errMsgBuf, int lineNum, JspCompilationContext ctxt)`
    `void` | `javacError(JavacErrorDetail[] javacErrors)`
    `void` | `javacError(String errorReport, Exception e)`
    `void` | `jspError(Exception e)`
    `void` | `jspError(Exception e, String errCode, String arg)`
    `void` | `jspError(org.apache.jasper.compiler.Mark where, Exception e, String errCode, String... args)`
    `void` | `jspError(org.apache.jasper.compiler.Mark where, String errCode)`
    `void` | `jspError(org.apache.jasper.compiler.Mark where, String errCode, String arg)`
    `void` | `jspError(org.apache.jasper.compiler.Mark where, String errCode, String arg1, String arg2)`
    `void` | `jspError(org.apache.jasper.compiler.Mark where, String errCode, String arg1, String arg2, String arg3)`
    `void` | `jspError(org.apache.jasper.compiler.Node n, Exception e, String errCode, String arg)`
    `void` | `jspError(org.apache.jasper.compiler.Node n, String errCode)`
    `void` | `jspError(org.apache.jasper.compiler.Node n, String errCode, String arg)`
    `void` | `jspError(org.apache.jasper.compiler.Node n, String errCode, String arg, Exception e)` Deprecated. Replaced by jspError(Node, Exception, String, String)
    `void` | `jspError(org.apache.jasper.compiler.Node n, String errCode, String arg1, String arg2)`
    `void` | `jspError(org.apache.jasper.compiler.Node n, String errCode, String arg1, String arg2, String arg3)`
    `void` | `jspError(String errCode)`
    `void` | `jspError(String errCode, String arg)`
    `void` | `jspError(String errCode, String arg, Exception e)` Deprecated. Replaced by jspError(Exception, String, String)
    `void` | `jspError(String errCode, String arg1, String arg2)`
    `void` | `jspError(String errCode, String arg1, String arg2, String arg3)`
    `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).

    - ### 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.Node n,
                      String errCode)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(String errCode,
                      String arg)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(String errCode,
                      String arg1,
                      String arg2)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(String errCode,
                      String arg1,
                      String arg2,
                      String arg3)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(org.apache.jasper.compiler.Mark where,
                      String errCode,
                      String arg1,
                      String arg2,
                      String arg3)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(org.apache.jasper.compiler.Node n,
                      String errCode,
                      String arg1,
                      String arg2,
                      String arg3)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

          public void jspError(Exception e)
                        throws JasperException

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

          @Deprecated
          public void jspError(String errCode,
                                 String arg,
                                 Exception e)
                        throws JasperException

      Deprecated. Replaced by jspError(Exception, String, String)
      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

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

      Throws:
        `JasperException`

    - #### jspError

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

      Deprecated. Replaced by jspError(Node, Exception, String, String)
      Throws:
        `JasperException`

    - #### parseJavacErrors

          public 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).
      Parameters:
        `errMsg` - Error message
        `fname` - Name of Java source file whose compilation failed
        `page` - Node representation of JSP page from which the Java source file was generated
      Returns:
        Array of javac compilation errors, or null if the given error message does not contain any compilation error line numbers
      Throws:
        `JasperException`
        `IOException`

    - #### javacError

          public void javacError(JavacErrorDetail[] javacErrors)
                          throws JasperException

      Throws:
        `JasperException`

    - #### javacError

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

      Throws:
        `JasperException`

    - #### createJavacError

          public static JavacErrorDetail createJavacError(String fname,
                                          Node.Nodes page,
                                          StringBuilder errMsgBuf,
                                          int lineNum)
                                                   throws JasperException

      Parameters:
        `fname` -
        `page` -
        `errMsgBuf` -
        `lineNum` -
      Returns:
        JavacErrorDetail The error details
      Throws:
        `JasperException`

    - #### createJavacError

          public static JavacErrorDetail createJavacError(String fname,
                                          Node.Nodes page,
                                          StringBuilder errMsgBuf,
                                          int lineNum,
                                          JspCompilationContext ctxt)
                                                   throws JasperException

      Parameters:
        `fname` -
        `page` -
        `errMsgBuf` -
        `lineNum` -
        `ctxt` -
      Returns:
        JavacErrorDetail The error details
      Throws:
        `JasperException`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.