FileDocCategorySizeDatePackage
ErrorPage.javaAPI DocApache Tomcat 6.0.144069Fri Jul 20 04:20:32 BST 2007org.apache.catalina.deploy

ErrorPage

public class ErrorPage extends Object implements Serializable
Representation of an error page element for a web application, as represented in a <error-page> element in the deployment descriptor.
author
Craig R. McClanahan
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
private int
errorCode
The error (status) code for which this error page is active.
private String
exceptionType
The exception type for which this error page is active.
private String
location
The context-relative location to handle this error or exception.
Constructors Summary
Methods Summary
public intgetErrorCode()
Return the error code.



    // ------------------------------------------------------------- Properties


             
       

        return (this.errorCode);

    
public java.lang.StringgetExceptionType()
Return the exception type.


        return (this.exceptionType);

    
public java.lang.StringgetLocation()
Return the location.


        return (this.location);

    
public voidsetErrorCode(int errorCode)
Set the error code.

param
errorCode The new error code


        this.errorCode = errorCode;

    
public voidsetErrorCode(java.lang.String errorCode)
Set the error code (hack for default XmlMapper data type).

param
errorCode The new error code


        try {
            this.errorCode = Integer.parseInt(errorCode);
        } catch (Throwable t) {
            this.errorCode = 0;
        }

    
public voidsetExceptionType(java.lang.String exceptionType)
Set the exception type.

param
exceptionType The new exception type


        this.exceptionType = exceptionType;

    
public voidsetLocation(java.lang.String location)
Set the location.

param
location The new location


        //        if ((location == null) || !location.startsWith("/"))
        //            throw new IllegalArgumentException
        //                ("Error Page Location must start with a '/'");
        this.location = RequestUtil.URLDecode(location);

    
public java.lang.StringtoString()
Render a String representation of this object.


        StringBuffer sb = new StringBuffer("ErrorPage[");
        if (exceptionType == null) {
            sb.append("errorCode=");
            sb.append(errorCode);
        } else {
            sb.append("exceptionType=");
            sb.append(exceptionType);
        }
        sb.append(", location=");
        sb.append(location);
        sb.append("]");
        return (sb.toString());