1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.servlet;
16  
17  import java.io.IOException;
18  
19  import java.util.Enumeration;
20  
21  import javax.el.ELContext;
22  
23  import javax.servlet.Servlet;
24  import javax.servlet.ServletConfig;
25  import javax.servlet.ServletContext;
26  import javax.servlet.ServletException;
27  import javax.servlet.ServletRequest;
28  import javax.servlet.ServletResponse;
29  import javax.servlet.http.HttpSession;
30  import javax.servlet.jsp.JspWriter;
31  import javax.servlet.jsp.PageContext;
32  
33  /**
34   * <a href="PageContextWrapper.java.html"><b><i>View Source</i></b></a>
35   *
36   * @author Brian Wing Shun Chan
37   */
38  public class PageContextWrapper extends PageContext {
39  
40      public PageContextWrapper(PageContext pageContext) {
41          _pageContext = pageContext;
42      }
43  
44      public Object findAttribute(String name) {
45          return _pageContext.findAttribute(name);
46      }
47  
48      public void forward(String relativeUrlPath)
49          throws IOException, ServletException {
50  
51          _pageContext.forward(relativeUrlPath);
52      }
53  
54      public Object getAttribute(String name) {
55          return _pageContext.getAttribute(name);
56      }
57  
58      public Object getAttribute(String name, int scope) {
59          return _pageContext.getAttribute(name, scope);
60      }
61  
62      public Enumeration<String> getAttributeNamesInScope(int scope) {
63          return _pageContext.getAttributeNamesInScope(scope);
64      }
65  
66      public int getAttributesScope(String name) {
67          return _pageContext.getAttributesScope(name);
68      }
69  
70      public ELContext getELContext() {
71          return _pageContext.getELContext();
72      }
73  
74      public Exception getException() {
75          return _pageContext.getException();
76      }
77  
78      /**
79       * @deprecated
80       */
81      public javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator() {
82          return _pageContext.getExpressionEvaluator();
83      }
84  
85      public JspWriter getOut() {
86          return _pageContext.getOut();
87      }
88  
89      public Object getPage() {
90          return _pageContext.getPage();
91      }
92  
93      public ServletRequest getRequest() {
94          return _pageContext.getRequest();
95      }
96  
97      public ServletResponse getResponse() {
98          return _pageContext.getResponse();
99      }
100 
101     public ServletConfig getServletConfig() {
102         return _pageContext.getServletConfig();
103     }
104 
105     public ServletContext getServletContext() {
106         return _pageContext.getServletContext();
107     }
108 
109     public HttpSession getSession() {
110         return _pageContext.getSession();
111     }
112 
113     /**
114      * @deprecated
115      */
116     public javax.servlet.jsp.el.VariableResolver getVariableResolver() {
117         return _pageContext.getVariableResolver();
118     }
119 
120     public void handlePageException(Exception e)
121         throws IOException, ServletException {
122 
123         _pageContext.handlePageException(e);
124     }
125 
126     public void handlePageException(Throwable t)
127         throws IOException, ServletException {
128 
129         _pageContext.handlePageException(t);
130     }
131 
132     public void include(String relativeUrlPath)
133         throws IOException, ServletException {
134 
135         _pageContext.include(relativeUrlPath);
136     }
137 
138     public void include(String relativeUrlPath, boolean flush)
139         throws IOException, ServletException {
140 
141         _pageContext.include(relativeUrlPath, flush);
142     }
143 
144     public void initialize(
145             Servlet servlet, ServletRequest request, ServletResponse response,
146             String errorPageURL, boolean needsSession, int bufferSize,
147             boolean autoFlush)
148         throws IllegalArgumentException, IllegalStateException, IOException {
149 
150         _pageContext.initialize(
151             servlet, request, response, errorPageURL, needsSession, bufferSize,
152             autoFlush);
153     }
154 
155     public void release() {
156         _pageContext.release();
157     }
158 
159     public void removeAttribute(String name) {
160         _pageContext.removeAttribute(name);
161     }
162 
163     public void removeAttribute(String name, int scope) {
164         _pageContext.removeAttribute(name, scope);
165     }
166 
167     public void setAttribute(String name, Object value) {
168         _pageContext.setAttribute(name, value);
169     }
170 
171     public void setAttribute(String name, Object value, int scope) {
172         _pageContext.setAttribute(name, value, scope);
173     }
174 
175     private PageContext _pageContext;
176 
177 }