1 28 29 package com.caucho.server.webapp; 30 31 import com.caucho.util.L10N; 32 33 import javax.annotation.PostConstruct; 34 import javax.servlet.ServletException ; 35 36 39 public class PathMapping { 40 static final L10N L = new L10N(PathMapping.class); 41 42 private String _urlPattern; 44 private String _urlRegexp; 46 47 private String _realPath; 49 50 53 public PathMapping() 54 { 55 } 56 57 60 public void setUrlPattern(String urlPattern) 61 { 62 _urlPattern = urlPattern; 63 } 64 65 68 public String getUrlPattern() 69 { 70 return _urlPattern; 71 } 72 73 76 public void setUrlRegexp(String urlRegexp) 77 { 78 _urlRegexp = urlRegexp; 79 } 80 81 84 public String getUrlRegexp() 85 { 86 return _urlRegexp; 87 } 88 89 92 public void setRealPath(String realPath) 93 { 94 _realPath = realPath; 95 } 96 97 100 public String getRealPath() 101 { 102 return _realPath; 103 } 104 105 108 @PostConstruct 109 public void init() 110 throws ServletException 111 { 112 if (_urlPattern != null) { 113 } 114 else if (_urlRegexp != null) { 115 } 116 else 117 throw new ServletException (L.l("path-mapping needs 'url-pattern' attribute.")); 118 if (_realPath == null) 119 throw new ServletException (L.l("path-mapping needs 'real-path' attribute.")); 120 } 121 } 122 | Popular Tags |