1 29 30 package com.caucho.server.webapp; 31 32 import com.caucho.util.L10N; 33 34 import javax.annotation.PostConstruct; 35 import javax.servlet.ServletException ; 36 37 40 public class ErrorPage { 41 static L10N L = new L10N(ErrorPage.class); 42 43 private String _location; 45 46 private String _exceptionType; 48 49 private int _errorCode = -1; 51 52 55 public ErrorPage() 56 { 57 } 58 59 62 public void setLocation(String location) 63 { 64 _location = location; 65 } 66 67 70 public String getLocation() 71 { 72 return _location; 73 } 74 75 78 public void setExceptionType(String exceptionType) 79 { 80 _exceptionType = exceptionType; 81 } 82 83 86 public String getExceptionType() 87 { 88 return _exceptionType; 89 } 90 91 94 public void setErrorCode(int code) 95 { 96 _errorCode = code; 97 } 98 99 102 public int getErrorCode() 103 { 104 return _errorCode; 105 } 106 107 110 @PostConstruct 111 public void init() 112 throws ServletException 113 { 114 if (_location == null) 115 throw new ServletException (L.l("error-page needs 'location' attribute.")); 116 } 117 } 118 | Popular Tags |