FileDocCategorySizeDatePackage
ErrorPage.javaAPI DocGlassfish v2 API5810Fri May 04 22:32:08 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: 1.4 $ $Date: 2007/05/05 05:32:08 $

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.
private String
reason
The reason string to be displayed with the error (status) code
Constructors Summary
Methods Summary
public intgetErrorCode()
Return the error code.

    // END SJSAS 6324911


    // ------------------------------------------------------------- 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 java.lang.StringgetReason()
Gets the reason string that is associated with the error (status) code for which this error page is active.

return
The reason string of this error page

        return reason;
    
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 voidsetReason(java.lang.String reason)
Sets the reason string to be associated with the error (status) code for which this error page is active.

param
reason The reason string

        this.reason = reason;
    
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());