1 20 package org.apache.cactus.server; 21 22 import java.io.IOException ; 23 24 import java.util.Enumeration ; 25 26 import javax.servlet.Servlet ; 27 import javax.servlet.ServletConfig ; 28 import javax.servlet.ServletContext ; 29 import javax.servlet.ServletException ; 30 import javax.servlet.ServletRequest ; 31 import javax.servlet.ServletResponse ; 32 import javax.servlet.http.HttpServletRequest ; 33 import javax.servlet.http.HttpSession ; 34 import javax.servlet.jsp.JspWriter ; 35 import javax.servlet.jsp.PageContext ; 36 import javax.servlet.jsp.tagext.BodyContent ; 37 38 import org.apache.cactus.ServletURL; 39 40 46 public abstract class AbstractPageContextWrapper extends PageContext 47 { 48 51 protected PageContext originalPageContext; 52 53 56 protected ServletURL url; 57 58 67 public AbstractPageContextWrapper(PageContext theOriginalPageContext, 68 ServletURL theURL) 69 { 70 this.originalPageContext = theOriginalPageContext; 71 this.url = theURL; 72 } 73 74 76 80 public ServletRequest getRequest() 81 { 82 return new HttpServletRequestWrapper( 84 (HttpServletRequest ) this.originalPageContext.getRequest(), 85 this.url); 86 } 87 88 91 public ServletConfig getServletConfig() 92 { 93 return new ServletConfigWrapper( 94 this.originalPageContext.getServletConfig()); 95 } 96 97 100 public ServletContext getServletContext() 101 { 102 return new ServletContextWrapper( 103 this.originalPageContext.getServletContext()); 104 } 105 106 108 111 public Object findAttribute(String theName) 112 { 113 return this.originalPageContext.findAttribute(theName); 114 } 115 116 119 public void forward(String theRelativeURLPath) throws ServletException , 120 IOException 121 { 122 this.originalPageContext.forward(theRelativeURLPath); 123 } 124 125 128 public Object getAttribute(String theName) 129 { 130 return this.originalPageContext.getAttribute(theName); 131 } 132 133 136 public Object getAttribute(String theName, int theScope) 137 { 138 return this.originalPageContext.getAttribute(theName, theScope); 139 } 140 141 144 public Enumeration getAttributeNamesInScope(int theScope) 145 { 146 return this.originalPageContext.getAttributeNamesInScope(theScope); 147 } 148 149 152 public int getAttributesScope(String theName) 153 { 154 return this.originalPageContext.getAttributesScope(theName); 155 } 156 157 160 public Exception getException() 161 { 162 return this.originalPageContext.getException(); 163 } 164 165 168 public JspWriter getOut() 169 { 170 return this.originalPageContext.getOut(); 171 } 172 173 176 public Object getPage() 177 { 178 return this.originalPageContext.getPage(); 179 } 180 181 184 public ServletResponse getResponse() 185 { 186 return this.originalPageContext.getResponse(); 187 } 188 189 192 public HttpSession getSession() 193 { 194 return this.originalPageContext.getSession(); 195 } 196 197 200 public void handlePageException(Exception theException) 201 throws ServletException , IOException 202 { 203 this.originalPageContext.handlePageException(theException); 204 } 205 206 209 public void include(String theRelativeURLPath) throws ServletException , 210 IOException 211 { 212 this.originalPageContext.include(theRelativeURLPath); 213 } 214 215 218 public void initialize(Servlet theServlet, ServletRequest theRequest, 219 ServletResponse theResponse, String theErrorPageURL, 220 boolean isSessionNeeded, int theBufferSize, boolean isAutoFlush) 221 throws IOException , IllegalStateException , IllegalArgumentException 222 { 223 this.originalPageContext.initialize(theServlet, theRequest, 224 theResponse, theErrorPageURL, isSessionNeeded, theBufferSize, 225 isAutoFlush); 226 } 227 228 231 public JspWriter popBody() 232 { 233 return this.originalPageContext.popBody(); 234 } 235 236 239 public BodyContent pushBody() 240 { 241 return this.originalPageContext.pushBody(); 242 } 243 244 247 public void release() 248 { 249 this.originalPageContext.release(); 250 } 251 252 255 public void removeAttribute(String theName) 256 { 257 this.originalPageContext.removeAttribute(theName); 258 } 259 260 263 public void removeAttribute(String theName, int theScope) 264 { 265 this.originalPageContext.removeAttribute(theName, theScope); 266 } 267 268 271 public void setAttribute(String theName, Object theAttribute) 272 { 273 this.originalPageContext.setAttribute(theName, theAttribute); 274 } 275 276 279 public void setAttribute(String theName, Object theAttribute, int theScope) 280 { 281 this.originalPageContext.setAttribute(theName, theAttribute, theScope); 282 } 283 } 284 | Popular Tags |