1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.container.invoker;
18
19 import javax.portlet.PortletRequest;
20 import javax.portlet.PortletResponse;
21 import javax.servlet.ServletRequest;
22 import javax.servlet.ServletResponse;
23 import javax.servlet.http.HttpServletRequestWrapper;
24 import javax.servlet.http.HttpServletResponseWrapper;
25
26 /***
27 * DefaultPortletRequestResponseUnwrapper implements PortletRequestResponseUnwrapper
28 * and finds servlet request or servlet response by simple unwrapping.
29 *
30 * @author <a href="mailto:woonsan@apache.org">Woonsan Ko</a>
31 * @version $Id: $
32 */
33 public class DefaultPortletRequestResponseUnwrapper implements PortletRequestResponseUnwrapper
34 {
35 public ServletRequest unwrapPortletRequest(PortletRequest portletRequest)
36 {
37 ServletRequest servletRequest = ((HttpServletRequestWrapper)((HttpServletRequestWrapper)((HttpServletRequestWrapper)portletRequest).getRequest()).getRequest()).getRequest();
38 return servletRequest;
39 }
40
41 public ServletResponse unwrapPortletResponse(PortletResponse portletResponse)
42 {
43 ServletResponse servletResponse = ((HttpServletResponseWrapper) portletResponse).getResponse();
44 return servletResponse;
45 }
46 }