for (Entry<String, HttpServlet> entry : servlets.entrySet()) { String urlPattern = entry.getKey(); HttpServlet servlet = entry.getValue(); if (request.getRequestURL().matches(urlPattern)) { servlet.service(request, response); break; } }
throw new ServletException("non-HTTP request or response"); service(request, response);
@Override public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String url = request.getRequestURI().replaceAll("^/go/rails/", "/go/"); servletHelper.getRequest(request).setRequestURI(url); rackServlet.service(request, response); }
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // add CORS headers for all HTTP responses (errors, etc.) if (boshManager.isCORSEnabled()) { if (boshManager.isAllOriginsAllowed()) { // Set the Access-Control-Allow-Origin header to * to allow all Origin to do the CORS response.setHeader("Access-Control-Allow-Origin", HttpBindManager.HTTP_BIND_CORS_ALLOW_ORIGIN_DEFAULT); } else { // Get the Origin header from the request and check if it is in the allowed Origin Map. // If it is allowed write it back to the Access-Control-Allow-Origin header of the respond. final String origin = request.getHeader("Origin"); if (boshManager.isThisOriginAllowed(origin)) { response.setHeader("Access-Control-Allow-Origin", origin); } } response.setHeader("Access-Control-Allow-Methods", HttpBindManager.HTTP_BIND_CORS_ALLOW_METHODS_DEFAULT); response.setHeader("Access-Control-Allow-Headers", HttpBindManager.HTTP_BIND_CORS_ALLOW_HEADERS_DEFAULT); response.setHeader("Access-Control-Max-Age", HttpBindManager.HTTP_BIND_CORS_MAX_AGE_DEFAULT); } super.service(request, response); }
HttpServlet servlet = (HttpServlet)servletInstance; servlet.init(servletConfig); servlet.service(request, response); return true;
throw new ServletException("non-HTTP request or response"); service(request, response);
@Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { setGwtProperties(req); super.service(req, resp); }
@Benchmark public void service() throws Exception { servlet.service(request, response); } }
throw new ServletException("non-HTTP request or response"); service(request, response);
@Override public void service( HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Thread currentThread = Thread.currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader( PortalClassLoaderUtil.getClassLoader()); _servlet.service(request, response); } finally { currentThread.setContextClassLoader(contextClassLoader); } }
private void doServiceImpl(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { GuiceFilter.Context previous = GuiceFilter.localContext.get(); HttpServletRequest originalRequest = (previous != null) ? previous.getOriginalRequest() : request; GuiceFilter.localContext.set(new GuiceFilter.Context(originalRequest, request, response)); try { httpServlet.get().service(request, response); } finally { GuiceFilter.localContext.set(previous); } }
/** * {@inheritDoc} * * javax.http.servlet.HttpServlet does not let to override the code which deals with * unrecognized HTTP verbs such as PATCH (being standardized), WebDav ones, etc. * Thus we let CXF servlets process unrecognized HTTP verbs directly, otherwise we delegate * to HttpService */ @Override public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { HttpServletRequest request; HttpServletResponse response; try { request = (HttpServletRequest) req; response = (HttpServletResponse) res; } catch (ClassCastException e) { throw new ServletException("Unrecognized HTTP request or response object"); } String method = request.getMethod(); if (KNOWN_HTTP_VERBS.contains(method)) { super.service(request, response); } else { handleRequest(request, response); } }
delegate.service(request, response);
servlet.service(request, response);
method = RequestTypeEnum.valueOf(theReq.getMethod()); } catch (IllegalArgumentException e) { super.service(theReq, theResp); return;
serviceListGenerator.service(request, res); } else { d = destinationRegistry.checkRestfulRequest(pathInfo);
/** * Override service, adding the setup for legacy. */ protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { // parse the parameters of the request, considering Unicode issues, into a ParameterParser ParameterParser parser = new ParameterParser(req); // make this available from the req as an attribute req.setAttribute(ATTR_PARAMS, parser); // Setup.setup(req, resp); super.service(req, resp); }
@Override public void doFilter(final ServletRequest filterRequest, final ServletResponse filterResponse) throws IOException, ServletException { getDispatcher().service(filterRequest, filterResponse); } };
@Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (req.getDispatcherType() == DispatcherType.ERROR) { doGet(req, resp); } else { super.service(req, resp); } }
@SuppressWarnings("unchecked") public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { HttpServletRequest httpRequest = (HttpServletRequest) request; Enumeration<String> names = (Enumeration<String>) httpRequest.getHeaderNames(); while (names.hasMoreElements()) { String name = names.nextElement(); String value = httpRequest.getHeader(name); OOZIE_HEADERS.put(name, value); } servlet.service(request, response); } }