01: package com.nabhinc.portlet.strutsbridge.impl;
02:
03: import javax.portlet.GenericPortlet;
04: import javax.portlet.PortletRequest;
05: import javax.portlet.PortletResponse;
06: import javax.servlet.ServletContext;
07: import javax.servlet.http.HttpServletRequest;
08: import javax.servlet.http.HttpServletResponse;
09:
10: import org.apache.portals.bridges.common.ServletContextProvider;
11:
12: import com.nabhinc.portal.container.HttpServletResponseStringbeansWrapper;
13: import com.nabhinc.portal.container.PortletContextImpl;
14: import com.nabhinc.portal.container.PortletRequestImpl;
15: import com.nabhinc.portal.container.RenderResponseImpl;
16:
17: /**
18: * Servlet Context Provider implementation for Weblogic
19: *
20: * @author Wirawan Chokry
21: * (c) 2006 Nabh Information Systems, Inc. All Rights Reserved.
22: */
23: public class ServletContextProviderImpl implements
24: ServletContextProvider {
25:
26: /* (non-Javadoc)
27: * @see org.apache.portals.bridges.common.ServletContextProvider#getServletContext(javax.portlet.GenericPortlet)
28: */
29: public ServletContext getServletContext(GenericPortlet portlet) {
30: return ((PortletContextImpl) portlet.getPortletContext())
31: .getServletContext();
32: }
33:
34: /* (non-Javadoc)
35: * @see org.apache.portals.bridges.common.ServletContextProvider#getHttpServletRequest(javax.portlet.GenericPortlet, javax.portlet.PortletRequest)
36: */
37: public HttpServletRequest getHttpServletRequest(
38: GenericPortlet portlet, PortletRequest request) {
39: return ((PortletRequestImpl) request).getHttpServletRequest();
40: }
41:
42: /* (non-Javadoc)
43: * @see org.apache.portals.bridges.common.ServletContextProvider#getHttpServletResponse(javax.portlet.GenericPortlet, javax.portlet.PortletResponse)
44: */
45: public HttpServletResponse getHttpServletResponse(
46: GenericPortlet portlet, PortletResponse response) {
47: // return ((PortletResponseImpl)response).getHttpServletResponse();
48: RenderResponseImpl rResp = (RenderResponseImpl) response;
49: HttpServletResponseStringbeansWrapper newResp = (HttpServletResponseStringbeansWrapper) rResp
50: .getHttpServletResponse();
51: newResp.setRenderResponse(rResp);
52: return newResp;
53:
54: }
55:
56: }
|