1 15 package org.apache.tapestry.portlet; 16 17 import java.io.IOException ; 18 19 import javax.portlet.PortletException; 20 import javax.portlet.RenderRequest; 21 import javax.portlet.RenderResponse; 22 23 import org.apache.tapestry.services.WebRequestServicer; 24 25 32 public class RenderRequestServicerToWebRequestServicerBridge implements RenderRequestServicer 33 { 34 35 private PortletRequestGlobals _portletRequestGlobals; 36 37 private WebRequestServicer _webRequestServicer; 38 39 public void service(RenderRequest request, RenderResponse response) throws IOException , 40 PortletException 41 { 42 _portletRequestGlobals.store(request, response); 43 44 PortletWebRequest webRequest = new PortletWebRequest(request); 45 PortletWebResponse webResponse = new RenderWebResponse(response); 46 47 try 48 { 49 _webRequestServicer.service(webRequest, webResponse); 50 } 51 catch (RuntimeException ex) 52 { 53 throw new PortletException(ex); 54 } 55 } 56 57 public void setPortletRequestGlobals(PortletRequestGlobals portletRequestGlobals) 58 { 59 _portletRequestGlobals = portletRequestGlobals; 60 } 61 62 public void setWebRequestServicer(WebRequestServicer webRequestServicer) 63 { 64 _webRequestServicer = webRequestServicer; 65 } 66 67 } | Popular Tags |