001 package railo.runtime.err; 002 003 import railo.runtime.PageSource; 004 /** 005 * 006 */ 007 public final class ErrorPageImpl implements ErrorPage { 008 009 // FUTURE move this to interface 010 public static final short TYPE_EXCEPTION=1; 011 public static final short TYPE_REQUEST=2; 012 public static final short TYPE_VALIDATION=4; 013 014 015 /** Type of exception. Required if type = "exception" or "monitor". */ 016 private String exception="any"; 017 018 /** The relative path to the custom error page. */ 019 private PageSource template; 020 021 /** The e-mail address of the administrator to notify of the error. The value 022 ** is available to your custom error page in the MailTo property of the error object. */ 023 private String mailto=""; 024 025 private short type; 026 027 028 029 030 /** 031 * @see railo.runtime.err.ErrorPage#setMailto(java.lang.String) 032 */ 033 public void setMailto(String mailto) { 034 this.mailto = mailto; 035 } 036 037 /** 038 * @see railo.runtime.err.ErrorPage#setTemplate(railo.runtime.PageSource) 039 */ 040 public void setTemplate(PageSource template) { 041 this.template = template; 042 } 043 044 /** 045 * @see railo.runtime.err.ErrorPage#setTypeAsString(java.lang.String) 046 */ 047 public void setTypeAsString(String exception) { 048 setException(exception); 049 } 050 public void setException(String exception) { 051 this.exception = exception; 052 } 053 054 /** 055 * @see railo.runtime.err.ErrorPage#getMailto() 056 */ 057 public String getMailto() { 058 return mailto; 059 } 060 /** 061 * @see railo.runtime.err.ErrorPage#getTemplate() 062 */ 063 public PageSource getTemplate() { 064 return template; 065 } 066 067 /** 068 * @see railo.runtime.err.ErrorPage#getTypeAsString() 069 */ 070 public String getTypeAsString() { 071 return getException(); 072 } 073 public String getException() { 074 return exception; 075 } 076 077 // FUTURE add to interface 078 public void setType(short type) { 079 this.type=type; 080 } 081 // FUTURE add to interface 082 public short getType() { 083 return type; 084 } 085 }