Source Code Cross Referenced for ServletRequestWrapper.java in  » Sevlet-Container » apache-tomcat-6.0.14 » javax » servlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » apache tomcat 6.0.14 » javax.servlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package javax.servlet;
018:
019:        import java.io.BufferedReader;
020:        import java.io.IOException;
021:        import java.util.Enumeration;
022:        import java.util.Locale;
023:        import java.util.Map;
024:
025:        /**
026:         * 
027:         * Provides a convenient implementation of the ServletRequest interface that
028:         * can be subclassed by developers wishing to adapt the request to a Servlet.
029:         * This class implements the Wrapper or Decorator pattern. Methods default to
030:         * calling through to the wrapped request object.
031:         * @since	v 2.3
032:         * 
033:         * 
034:         *
035:         * @see 	javax.servlet.ServletRequest
036:         *
037:         */
038:
039:        public class ServletRequestWrapper implements  ServletRequest {
040:            private ServletRequest request;
041:
042:            /**
043:             * Creates a ServletRequest adaptor wrapping the given request object. 
044:             * @throws java.lang.IllegalArgumentException if the request is null
045:             */
046:
047:            public ServletRequestWrapper(ServletRequest request) {
048:                if (request == null) {
049:                    throw new IllegalArgumentException("Request cannot be null");
050:                }
051:                this .request = request;
052:            }
053:
054:            /**
055:             * Return the wrapped request object.
056:             */
057:            public ServletRequest getRequest() {
058:                return this .request;
059:            }
060:
061:            /**
062:             * Sets the request object being wrapped. 
063:             * @throws java.lang.IllegalArgumentException if the request is null.
064:             */
065:
066:            public void setRequest(ServletRequest request) {
067:                if (request == null) {
068:                    throw new IllegalArgumentException("Request cannot be null");
069:                }
070:                this .request = request;
071:            }
072:
073:            /**
074:             *
075:             * The default behavior of this method is to call getAttribute(String name)
076:             * on the wrapped request object.
077:             */
078:
079:            public Object getAttribute(String name) {
080:                return this .request.getAttribute(name);
081:            }
082:
083:            /**
084:             * The default behavior of this method is to return getAttributeNames()
085:             * on the wrapped request object.
086:             */
087:
088:            public Enumeration getAttributeNames() {
089:                return this .request.getAttributeNames();
090:            }
091:
092:            /**
093:             * The default behavior of this method is to return getCharacterEncoding()
094:             * on the wrapped request object.
095:             */
096:
097:            public String getCharacterEncoding() {
098:                return this .request.getCharacterEncoding();
099:            }
100:
101:            /**
102:             * The default behavior of this method is to set the character encoding
103:             * on the wrapped request object.
104:             */
105:
106:            public void setCharacterEncoding(String enc)
107:                    throws java.io.UnsupportedEncodingException {
108:                this .request.setCharacterEncoding(enc);
109:            }
110:
111:            /**
112:             * The default behavior of this method is to return getContentLength()
113:             * on the wrapped request object.
114:             */
115:
116:            public int getContentLength() {
117:                return this .request.getContentLength();
118:            }
119:
120:            /**
121:             * The default behavior of this method is to return getContentType()
122:             * on the wrapped request object.
123:             */
124:            public String getContentType() {
125:                return this .request.getContentType();
126:            }
127:
128:            /**
129:             * The default behavior of this method is to return getInputStream()
130:             * on the wrapped request object.
131:             */
132:
133:            public ServletInputStream getInputStream() throws IOException {
134:                return this .request.getInputStream();
135:            }
136:
137:            /**
138:             * The default behavior of this method is to return getParameter(String name)
139:             * on the wrapped request object.
140:             */
141:
142:            public String getParameter(String name) {
143:                return this .request.getParameter(name);
144:            }
145:
146:            /**
147:             * The default behavior of this method is to return getParameterMap()
148:             * on the wrapped request object.
149:             */
150:            public Map getParameterMap() {
151:                return this .request.getParameterMap();
152:            }
153:
154:            /**
155:             * The default behavior of this method is to return getParameterNames()
156:             * on the wrapped request object.
157:             */
158:
159:            public Enumeration getParameterNames() {
160:                return this .request.getParameterNames();
161:            }
162:
163:            /**
164:             * The default behavior of this method is to return getParameterValues(String name)
165:             * on the wrapped request object.
166:             */
167:            public String[] getParameterValues(String name) {
168:                return this .request.getParameterValues(name);
169:            }
170:
171:            /**
172:             * The default behavior of this method is to return getProtocol()
173:             * on the wrapped request object.
174:             */
175:
176:            public String getProtocol() {
177:                return this .request.getProtocol();
178:            }
179:
180:            /**
181:             * The default behavior of this method is to return getScheme()
182:             * on the wrapped request object.
183:             */
184:
185:            public String getScheme() {
186:                return this .request.getScheme();
187:            }
188:
189:            /**
190:             * The default behavior of this method is to return getServerName()
191:             * on the wrapped request object.
192:             */
193:            public String getServerName() {
194:                return this .request.getServerName();
195:            }
196:
197:            /**
198:             * The default behavior of this method is to return getServerPort()
199:             * on the wrapped request object.
200:             */
201:
202:            public int getServerPort() {
203:                return this .request.getServerPort();
204:            }
205:
206:            /**
207:             * The default behavior of this method is to return getReader()
208:             * on the wrapped request object.
209:             */
210:
211:            public BufferedReader getReader() throws IOException {
212:                return this .request.getReader();
213:            }
214:
215:            /**
216:             * The default behavior of this method is to return getRemoteAddr()
217:             * on the wrapped request object.
218:             */
219:
220:            public String getRemoteAddr() {
221:                return this .request.getRemoteAddr();
222:            }
223:
224:            /**
225:             * The default behavior of this method is to return getRemoteHost()
226:             * on the wrapped request object.
227:             */
228:
229:            public String getRemoteHost() {
230:                return this .request.getRemoteHost();
231:            }
232:
233:            /**
234:             * The default behavior of this method is to return setAttribute(String name, Object o)
235:             * on the wrapped request object.
236:             */
237:
238:            public void setAttribute(String name, Object o) {
239:                this .request.setAttribute(name, o);
240:            }
241:
242:            /**
243:             * The default behavior of this method is to call removeAttribute(String name)
244:             * on the wrapped request object.
245:             */
246:            public void removeAttribute(String name) {
247:                this .request.removeAttribute(name);
248:            }
249:
250:            /**
251:             * The default behavior of this method is to return getLocale()
252:             * on the wrapped request object.
253:             */
254:
255:            public Locale getLocale() {
256:                return this .request.getLocale();
257:            }
258:
259:            /**
260:             * The default behavior of this method is to return getLocales()
261:             * on the wrapped request object.
262:             */
263:
264:            public Enumeration getLocales() {
265:                return this .request.getLocales();
266:            }
267:
268:            /**
269:             * The default behavior of this method is to return isSecure()
270:             * on the wrapped request object.
271:             */
272:
273:            public boolean isSecure() {
274:                return this .request.isSecure();
275:            }
276:
277:            /**
278:             * The default behavior of this method is to return getRequestDispatcher(String path)
279:             * on the wrapped request object.
280:             */
281:
282:            public RequestDispatcher getRequestDispatcher(String path) {
283:                return this .request.getRequestDispatcher(path);
284:            }
285:
286:            /**
287:             * The default behavior of this method is to return getRealPath(String path)
288:             * on the wrapped request object.
289:             */
290:
291:            public String getRealPath(String path) {
292:                return this .request.getRealPath(path);
293:            }
294:
295:            /**
296:             * The default behavior of this method is to return
297:             * getRemotePort() on the wrapped request object.
298:             *
299:             * @since 2.4
300:             */
301:            public int getRemotePort() {
302:                return this .request.getRemotePort();
303:            }
304:
305:            /**
306:             * The default behavior of this method is to return
307:             * getLocalName() on the wrapped request object.
308:             *
309:             * @since 2.4
310:             */
311:            public String getLocalName() {
312:                return this .request.getLocalName();
313:            }
314:
315:            /**
316:             * The default behavior of this method is to return
317:             * getLocalAddr() on the wrapped request object.
318:             *
319:             * @since 2.4
320:             */
321:            public String getLocalAddr() {
322:                return this .request.getLocalAddr();
323:            }
324:
325:            /**
326:             * The default behavior of this method is to return
327:             * getLocalPort() on the wrapped request object.
328:             *
329:             * @since 2.4
330:             */
331:            public int getLocalPort() {
332:                return this.request.getLocalPort();
333:            }
334:
335:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.