@Override public String getRequestMethod() { return request.getMethod(); }
@Override public boolean isRequestMethod(String method) { return request.getMethod().equalsIgnoreCase(method); }
@Override public String toString() { return "Request{" + "requestMethod='" + getMethod() + '\'' + ", uriPattern='" + getApplicationUri() + '\'' + '}'; }
@Override public String getRequestMethod() { return getRequest().getMethod(); }
@Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; // TODO test for redirect // no redirect; process the request // create Request, Response objects RequestResponseFactory requestResponseFactory = application.getRequestResponseFactory(); RequestResponse requestResponse = requestResponseFactory.createRequestResponse(httpServletRequest, httpServletResponse); Request request = requestResponse.getRequest(); Response response = requestResponse.getResponse(); // create a URI to automatically decode the path URI uri = URI.create(httpServletRequest.getRequestURL().toString()); String requestUri = uri.getPath(); String requestPath = request.getPath(); log.trace("The relative path for '{}' is '{}'", requestUri, requestPath); // check for ignore path if (shouldIgnorePath(requestPath)) { log.debug("Ignoring request '{}'", requestPath); if (chain != null) { chain.doFilter(servletRequest, servletResponse); } return; } log.debug("Request {} '{}'", request.getMethod(), requestPath); processRequest(request, response); }
@Override public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; // set the application path from the servlet request since we don't know it at initialization String applicationPath = application.getRouter().getContextPath() + httpServletRequest.getServletPath(); application.getRouter().setApplicationPath(applicationPath); // create Request, Response objects RequestResponseFactory requestResponseFactory = application.getRequestResponseFactory(); RequestResponse requestResponse = requestResponseFactory.createRequestResponse(httpServletRequest, httpServletResponse); Request request = requestResponse.getRequest(); Response response = requestResponse.getResponse(); // create a URI to automatically decode the path URI uri = URI.create(httpServletRequest.getRequestURL().toString()); String requestUri = uri.getPath(); String requestPath = request.getPath(); log.trace("The relative path for '{}' is '{}'", requestUri, requestPath); log.debug("Request {} '{}'", request.getMethod(), requestPath); // dispatch route(s) routeDispatcher.dispatch(request, response); }
final String requestMethod = request.getMethod();