FileDocCategorySizeDatePackage
DefaultErrorHandler.javaAPI DocApache Tomcat 6.0.143982Fri Jul 20 04:20:36 BST 2007org.apache.jasper.compiler

DefaultErrorHandler

public class DefaultErrorHandler extends Object implements ErrorHandler
Default implementation of ErrorHandler interface.
author
Jan Luehe

Fields Summary
Constructors Summary
Methods Summary
public voidjavacError(JavacErrorDetail[] details)

        
        if (details == null) {
            return;
        }
        
        Object[] args = null;
        StringBuffer buf = new StringBuffer();
        
        for (int i=0; i < details.length; i++) {
            if (details[i].getJspBeginLineNumber() >= 0) {
                args = new Object[] {
                        new Integer(details[i].getJspBeginLineNumber()), 
                        details[i].getJspFileName() };
                buf.append("\n\n");
                buf.append(Localizer.getMessage("jsp.error.single.line.number",
                        args));
                buf.append("\n");
                buf.append(details[i].getErrorMessage());
                buf.append("\n");
                buf.append(details[i].getJspExtract());
            } else {
                args = new Object[] {
                        new Integer(details[i].getJavaLineNumber()) };
                buf.append("\n\n");
                buf.append(Localizer.getMessage("jsp.error.java.line.number",
                        args));
                buf.append("\n");
                buf.append(details[i].getErrorMessage());
            }
        }
        buf.append("\n\nStacktrace:");
        throw new JasperException(
                Localizer.getMessage("jsp.error.unable.compile") + ": " + buf);
    
public voidjavacError(java.lang.String errorReport, java.lang.Exception exception)
Processes the given javac error report and exception.

param
errorReport Compilation error report
param
exception Compilation exception

        
        throw new JasperException(
                Localizer.getMessage("jsp.error.unable.compile"), exception);
    
public voidjspError(java.lang.String fname, int line, int column, java.lang.String errMsg, java.lang.Exception ex)

        throw new JasperException(fname + "(" + line + "," + column + ")"
                + " " + errMsg, ex);
    
public voidjspError(java.lang.String errMsg, java.lang.Exception ex)

        throw new JasperException(errMsg, ex);