blob: eeb5b1d17b39ab933692ff939ffa9de10040f9cd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/*******************************************************************************
* Copyright (c) 2005-2007 Cognos Incorporated, IBM Corporation and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Cognos Incorporated - initial API and implementation
* IBM Corporation - bug fixes and enhancements
*******************************************************************************/
package org.eclipse.equinox.http.servlet.internal;
import java.io.IOException;
import javax.servlet.*;
//This class unwraps the request so it can be processed by the underlying servlet container.
public class RequestDispatcherAdaptor implements RequestDispatcher {
private RequestDispatcher requestDispatcher;
public RequestDispatcherAdaptor(RequestDispatcher requestDispatcher) {
this.requestDispatcher = requestDispatcher;
}
public void forward(ServletRequest req, ServletResponse resp) throws ServletException, IOException {
if (req instanceof HttpServletRequestAdaptor)
req = ((HttpServletRequestAdaptor) req).getRequest();
requestDispatcher.forward(req, resp);
}
public void include(ServletRequest req, ServletResponse resp) throws ServletException, IOException {
if (req instanceof HttpServletRequestAdaptor)
req = ((HttpServletRequestAdaptor) req).getRequest();
requestDispatcher.include(req, resp);
}
}
|