View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.struts2.jasper.compiler;
19  
20  import org.apache.struts2.jasper.JasperException;
21  
22  /***
23   * Interface for handling JSP parse and javac compilation errors.
24   * <p/>
25   * An implementation of this interface may be registered with the
26   * ErrorDispatcher by setting the XXX initialization parameter in the JSP
27   * page compiler and execution servlet in Catalina's web.xml file to the
28   * implementation's fully qualified class name.
29   *
30   * @author Jan Luehe
31   * @author Kin-man Chung
32   */
33  public interface ErrorHandler {
34  
35      /***
36       * Processes the given JSP parse error.
37       *
38       * @param fname     Name of the JSP file in which the parse error occurred
39       * @param line      Parse error line number
40       * @param column    Parse error column number
41       * @param msg       Parse error message
42       * @param exception Parse exception
43       */
44      public void jspError(String fname, int line, int column, String msg,
45                           Exception exception) throws JasperException;
46  
47      /***
48       * Processes the given JSP parse error.
49       *
50       * @param msg       Parse error message
51       * @param exception Parse exception
52       */
53      public void jspError(String msg, Exception exception)
54              throws JasperException;
55  
56      /***
57       * Processes the given javac compilation errors.
58       *
59       * @param details Array of JavacErrorDetail instances corresponding to the
60       *                compilation errors
61       */
62      public void javacError(JavacErrorDetail[] details)
63              throws JasperException;
64  
65      /***
66       * Processes the given javac error report and exception.
67       *
68       * @param errorReport Compilation error report
69       * @param exception   Compilation exception
70       */
71      public void javacError(String errorReport, Exception exception)
72              throws JasperException;
73  }