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:
018: package org.apache.catalina.core;
019:
020: import java.io.BufferedReader;
021: import java.io.IOException;
022: import java.io.InputStream;
023: import java.io.UnsupportedEncodingException;
024: import java.net.Socket;
025: import java.security.Principal;
026: import java.util.Enumeration;
027: import java.util.Iterator;
028: import java.util.Locale;
029: import java.util.Map;
030:
031: import javax.servlet.FilterChain;
032: import javax.servlet.RequestDispatcher;
033: import javax.servlet.ServletInputStream;
034: import javax.servlet.ServletRequest;
035: import javax.servlet.http.Cookie;
036: import javax.servlet.http.HttpServletRequest;
037: import javax.servlet.http.HttpSession;
038:
039: import org.apache.catalina.Context;
040: import org.apache.catalina.Host;
041: import org.apache.catalina.Wrapper;
042: import org.apache.catalina.connector.Connector;
043: import org.apache.catalina.connector.Response;
044: import org.apache.tomcat.util.buf.MessageBytes;
045:
046: /**
047: * Dummy request object, used for request dispatcher mapping, as well as
048: * JSP precompilation.
049: *
050: * @author Remy Maucherat
051: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
052: */
053:
054: public class DummyRequest implements HttpServletRequest {
055:
056: public DummyRequest() {
057: }
058:
059: public DummyRequest(String contextPath, String decodedURI,
060: String queryString) {
061: this .contextPath = contextPath;
062: this .decodedURI = decodedURI;
063: this .queryString = queryString;
064: }
065:
066: protected String contextPath = null;
067: protected String decodedURI = null;
068: protected String queryString = null;
069:
070: protected String pathInfo = null;
071: protected String servletPath = null;
072: protected Wrapper wrapper = null;
073:
074: protected FilterChain filterChain = null;
075:
076: private static Enumeration dummyEnum = new Enumeration() {
077: public boolean hasMoreElements() {
078: return false;
079: }
080:
081: public Object nextElement() {
082: return null;
083: }
084: };
085:
086: public String getContextPath() {
087: return (contextPath);
088: }
089:
090: public MessageBytes getContextPathMB() {
091: return null;
092: }
093:
094: public ServletRequest getRequest() {
095: return (this );
096: }
097:
098: public String getDecodedRequestURI() {
099: return decodedURI;
100: }
101:
102: public MessageBytes getDecodedRequestURIMB() {
103: return null;
104: }
105:
106: public FilterChain getFilterChain() {
107: return (this .filterChain);
108: }
109:
110: public void setFilterChain(FilterChain filterChain) {
111: this .filterChain = filterChain;
112: }
113:
114: public String getQueryString() {
115: return queryString;
116: }
117:
118: public void setQueryString(String query) {
119: queryString = query;
120: }
121:
122: public String getPathInfo() {
123: return pathInfo;
124: }
125:
126: public void setPathInfo(String path) {
127: pathInfo = path;
128: }
129:
130: public MessageBytes getPathInfoMB() {
131: return null;
132: }
133:
134: public MessageBytes getRequestPathMB() {
135: return null;
136: }
137:
138: public String getServletPath() {
139: return servletPath;
140: }
141:
142: public void setServletPath(String path) {
143: servletPath = path;
144: }
145:
146: public MessageBytes getServletPathMB() {
147: return null;
148: }
149:
150: public Wrapper getWrapper() {
151: return (this .wrapper);
152: }
153:
154: public void setWrapper(Wrapper wrapper) {
155: this .wrapper = wrapper;
156: }
157:
158: public String getAuthorization() {
159: return null;
160: }
161:
162: public void setAuthorization(String authorization) {
163: }
164:
165: public Connector getConnector() {
166: return null;
167: }
168:
169: public void setConnector(Connector connector) {
170: }
171:
172: public Context getContext() {
173: return null;
174: }
175:
176: public void setContext(Context context) {
177: }
178:
179: public Host getHost() {
180: return null;
181: }
182:
183: public void setHost(Host host) {
184: }
185:
186: public String getInfo() {
187: return null;
188: }
189:
190: public Response getResponse() {
191: return null;
192: }
193:
194: public void setResponse(Response response) {
195: }
196:
197: public Socket getSocket() {
198: return null;
199: }
200:
201: public void setSocket(Socket socket) {
202: }
203:
204: public InputStream getStream() {
205: return null;
206: }
207:
208: public void setStream(InputStream input) {
209: }
210:
211: public void addLocale(Locale locale) {
212: }
213:
214: public ServletInputStream createInputStream() throws IOException {
215: return null;
216: }
217:
218: public void finishRequest() throws IOException {
219: }
220:
221: public Object getNote(String name) {
222: return null;
223: }
224:
225: public Iterator getNoteNames() {
226: return null;
227: }
228:
229: public void removeNote(String name) {
230: }
231:
232: public void setContentType(String type) {
233: }
234:
235: public void setNote(String name, Object value) {
236: }
237:
238: public void setProtocol(String protocol) {
239: }
240:
241: public void setRemoteAddr(String remoteAddr) {
242: }
243:
244: public void setRemoteHost(String remoteHost) {
245: }
246:
247: public void setScheme(String scheme) {
248: }
249:
250: public void setServerName(String name) {
251: }
252:
253: public void setServerPort(int port) {
254: }
255:
256: public Object getAttribute(String name) {
257: return null;
258: }
259:
260: public Enumeration getAttributeNames() {
261: return null;
262: }
263:
264: public String getCharacterEncoding() {
265: return null;
266: }
267:
268: public int getContentLength() {
269: return -1;
270: }
271:
272: public void setContentLength(int length) {
273: }
274:
275: public String getContentType() {
276: return null;
277: }
278:
279: public ServletInputStream getInputStream() throws IOException {
280: return null;
281: }
282:
283: public Locale getLocale() {
284: return null;
285: }
286:
287: public Enumeration getLocales() {
288: return null;
289: }
290:
291: public String getProtocol() {
292: return null;
293: }
294:
295: public BufferedReader getReader() throws IOException {
296: return null;
297: }
298:
299: public String getRealPath(String path) {
300: return null;
301: }
302:
303: public String getRemoteAddr() {
304: return null;
305: }
306:
307: public String getRemoteHost() {
308: return null;
309: }
310:
311: public String getScheme() {
312: return null;
313: }
314:
315: public String getServerName() {
316: return null;
317: }
318:
319: public int getServerPort() {
320: return -1;
321: }
322:
323: public boolean isSecure() {
324: return false;
325: }
326:
327: public void removeAttribute(String name) {
328: }
329:
330: public void setAttribute(String name, Object value) {
331: }
332:
333: public void setCharacterEncoding(String enc)
334: throws UnsupportedEncodingException {
335: }
336:
337: public void addCookie(Cookie cookie) {
338: }
339:
340: public void addHeader(String name, String value) {
341: }
342:
343: public void addParameter(String name, String values[]) {
344: }
345:
346: public void clearCookies() {
347: }
348:
349: public void clearHeaders() {
350: }
351:
352: public void clearLocales() {
353: }
354:
355: public void clearParameters() {
356: }
357:
358: public void recycle() {
359: }
360:
361: public void setAuthType(String authType) {
362: }
363:
364: public void setContextPath(String path) {
365: }
366:
367: public void setMethod(String method) {
368: }
369:
370: public void setRequestedSessionCookie(boolean flag) {
371: }
372:
373: public void setRequestedSessionId(String id) {
374: }
375:
376: public void setRequestedSessionURL(boolean flag) {
377: }
378:
379: public void setRequestURI(String uri) {
380: }
381:
382: public void setSecure(boolean secure) {
383: }
384:
385: public void setUserPrincipal(Principal principal) {
386: }
387:
388: public String getParameter(String name) {
389: return null;
390: }
391:
392: public Map getParameterMap() {
393: return null;
394: }
395:
396: public Enumeration getParameterNames() {
397: return dummyEnum;
398: }
399:
400: public String[] getParameterValues(String name) {
401: return null;
402: }
403:
404: public RequestDispatcher getRequestDispatcher(String path) {
405: return null;
406: }
407:
408: public String getAuthType() {
409: return null;
410: }
411:
412: public Cookie[] getCookies() {
413: return null;
414: }
415:
416: public long getDateHeader(String name) {
417: return -1;
418: }
419:
420: public String getHeader(String name) {
421: return null;
422: }
423:
424: public Enumeration getHeaders(String name) {
425: return null;
426: }
427:
428: public Enumeration getHeaderNames() {
429: return null;
430: }
431:
432: public int getIntHeader(String name) {
433: return -1;
434: }
435:
436: public String getMethod() {
437: return null;
438: }
439:
440: public String getPathTranslated() {
441: return null;
442: }
443:
444: public String getRemoteUser() {
445: return null;
446: }
447:
448: public String getRequestedSessionId() {
449: return null;
450: }
451:
452: public String getRequestURI() {
453: return null;
454: }
455:
456: public void setDecodedRequestURI(String uri) {
457: }
458:
459: public StringBuffer getRequestURL() {
460: return null;
461: }
462:
463: public HttpSession getSession() {
464: return null;
465: }
466:
467: public HttpSession getSession(boolean create) {
468: return null;
469: }
470:
471: public boolean isRequestedSessionIdFromCookie() {
472: return false;
473: }
474:
475: public boolean isRequestedSessionIdFromURL() {
476: return false;
477: }
478:
479: public boolean isRequestedSessionIdFromUrl() {
480: return false;
481: }
482:
483: public boolean isRequestedSessionIdValid() {
484: return false;
485: }
486:
487: public boolean isUserInRole(String role) {
488: return false;
489: }
490:
491: public Principal getUserPrincipal() {
492: return null;
493: }
494:
495: public String getLocalAddr() {
496: return null;
497: }
498:
499: public String getLocalName() {
500: return null;
501: }
502:
503: public int getLocalPort() {
504: return -1;
505: }
506:
507: public int getRemotePort() {
508: return -1;
509: }
510:
511: }
|