public boolean service(Request request, Response response) throws IOException { // Update RequestGlobals with the current request/response (in case // some filter replaced the // normal set). requestGlobals.storeRequestResponse(request, response); return masterDispatcher.dispatch(request, response); } }
public boolean service(Request request, Response response, RequestHandler handler) throws IOException { requestGlobals.storeRequestResponse(request, response); return handler.service(request, response); } };
public boolean service(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws IOException { requestGlobals.storeServletRequestResponse(servletRequest, servletResponse); // Should have started doing this a long time ago: recoding attributes into // the request for things that may be needed downstream, without having to extend // Request. servletRequest.setAttribute("servletAPI.protocol", servletRequest.getProtocol()); servletRequest.setAttribute("servletAPI.characterEncoding", servletRequest.getCharacterEncoding()); servletRequest.setAttribute("servletAPI.contentLength", servletRequest.getContentLength()); servletRequest.setAttribute("servletAPI.authType", servletRequest.getAuthType()); servletRequest.setAttribute("servletAPI.contentType", servletRequest.getContentType()); servletRequest.setAttribute("servletAPI.scheme", servletRequest.getScheme()); Request request = new RequestImpl(servletRequest, applicationCharset, sessionFactory); Response response = new ResponseImpl(servletRequest, servletResponse); // TAP5-257: Make sure that the "initial guess" for request/response // is available, even ifsome filter in the RequestHandler pipeline replaces them. // Which just goes to show that there should have been only one way to access the Request/Response: // either functionally (via parameters) or global (via ReqeuestGlobals) but not both. // That ship has sailed. requestGlobals.storeRequestResponse(request, response); // Transition from the Servlet API-based pipeline, to the // Tapestry-based pipeline. return handler.service(request, response); } }