1 15 package org.apache.tapestry.services.impl; 16 17 import java.io.IOException ; 18 19 import javax.servlet.ServletException ; 20 import javax.servlet.http.HttpServletRequest ; 21 import javax.servlet.http.HttpServletResponse ; 22 23 import org.apache.tapestry.services.RequestGlobals; 24 import org.apache.tapestry.services.ServletRequestServicer; 25 import org.apache.tapestry.services.WebRequestServicer; 26 import org.apache.tapestry.web.ServletWebRequest; 27 import org.apache.tapestry.web.ServletWebResponse; 28 import org.apache.tapestry.web.WebRequest; 29 import org.apache.tapestry.web.WebResponse; 30 31 40 public class WebRequestServicerPipelineBridge implements ServletRequestServicer 41 { 42 private RequestGlobals _requestGlobals; 43 44 private WebRequestServicer _webRequestServicer; 45 46 public void service(HttpServletRequest request, HttpServletResponse response) 47 throws IOException , ServletException 48 { 49 _requestGlobals.store(request, response); 50 51 WebRequest webRequest = new ServletWebRequest(request, response); 52 WebResponse webResponse = new ServletWebResponse(response); 53 54 try 55 { 56 _webRequestServicer.service(webRequest, webResponse); 57 } 58 catch (RuntimeException ex) 59 { 60 throw new ServletException (ex); 61 } 62 } 63 64 public void setRequestGlobals(RequestGlobals requestGlobals) 65 { 66 _requestGlobals = requestGlobals; 67 } 68 69 public void setWebRequestServicer(WebRequestServicer webRequestServicer) 70 { 71 _webRequestServicer = webRequestServicer; 72 } 73 } | Popular Tags |