@Signature public String path() { return request.getPathInfo(); }
@Override public String getRelativePath() { return request.getServletPath() + (request.getPathInfo() != null ? request.getPathInfo() : ""); }
@Override public String getRelativePath() { return request.getServletPath() + (request.getPathInfo() != null ? request.getPathInfo() : ""); }
@Override public void handle( Request request, HttpServletResponse response ) { path.set(request.getPathInfo()); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { path.set(request.getPathInfo()); response.setStatus(HTTP_OK); } };
@Override public void handle( Request request, HttpServletResponse response ) { path.set(request.getPathInfo()); response.setStatus(HTTP_OK); } };
@Override public void customize(Connector connector, HttpConfiguration channelConfig, Request request) { try { matchAndApply(request.getPathInfo(), request, request.getResponse()); } catch (IOException e) { throw new RuntimeIOException(e); } } }
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (!request.isSecure()) { baseRequest.getResponse().sendRedirect("https://" + baseRequest.getServerName() + ":" + httpsPort + baseRequest.getPathInfo()); baseRequest.setHandled(true); } else { getHandler().handle(target, baseRequest, request, response); } } }
@Override public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException { if (!_asyncSupported) throw new IllegalStateException("!asyncSupported"); HttpChannelState state = getHttpChannelState(); if (_async==null) _async=new AsyncContextState(state); AsyncContextEvent event = new AsyncContextEvent(_context,_async,state,this,servletRequest,servletResponse); event.setDispatchContext(getServletContext()); event.setDispatchPath(URIUtil.addPaths(getServletPath(),getPathInfo())); state.startAsync(event); return _async; }
@Override public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException { if (_asyncNotSupportedSource!=null) throw new IllegalStateException("!asyncSupported: "+_asyncNotSupportedSource); HttpChannelState state = getHttpChannelState(); if (_async==null) _async=new AsyncContextState(state); AsyncContextEvent event = new AsyncContextEvent(_context,_async,state,this,servletRequest,servletResponse); event.setDispatchContext(getServletContext()); event.setDispatchPath(URIUtil.addPaths(getServletPath(),getPathInfo())); state.startAsync(event); return _async; }
@Override public void doHandle(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { final String newTarget = redirectContext + target; RequestUpdateHandler.ForwardedRequest newRequest = new RequestUpdateHandler.ForwardedRequest( request, redirectContext, newTarget); // if the request already has the /{gatewaypath}/{topology} part then skip if (!StringUtils.startsWithIgnoreCase(target, redirectContext)) { baseRequest.setPathInfo(redirectContext + baseRequest.getPathInfo()); baseRequest.setURIPathQuery(redirectContext + baseRequest.getRequestURI()); LOG.topologyPortMappingUpdateRequest(target, newTarget); nextHandle(newTarget, baseRequest, newRequest, response); } else { nextHandle(target, baseRequest, newRequest, response); } }
@Override public void doHandle(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { final String newTarget = redirectContext + target; RequestUpdateHandler.ForwardedRequest newRequest = new RequestUpdateHandler.ForwardedRequest( request, redirectContext, newTarget); // if the request already has the /{gatewaypath}/{topology} part then skip if (!StringUtils.startsWithIgnoreCase(target, redirectContext)) { baseRequest.setPathInfo(redirectContext + baseRequest.getPathInfo()); baseRequest.setURIPathQuery(redirectContext + baseRequest.getRequestURI()); LOG.topologyPortMappingUpdateRequest(target, newTarget); nextHandle(newTarget, baseRequest, newRequest, response); } else { nextHandle(target, baseRequest, newRequest, response); } }
public void handle(AbstractHttpConnection connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) { LOG.debug("REQUEST "+target+" on "+connection); handle(target, request, request, response); LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); } else handle(target, request, request, response); }
public void handle(AbstractHttpConnection connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) { LOG.debug("REQUEST "+target+" on "+connection); handle(target, request, request, response); LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); } else handle(target, request, request, response); }
public void handle(AbstractHttpConnection connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) { LOG.debug("REQUEST "+target+" on "+connection); handle(target, request, request, response); LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); } else handle(target, request, request, response); }
public void handle(HttpChannel<?> connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) LOG.debug("REQUEST "+target+" on "+connection); if ("*".equals(target)) { handleOptions(request,response); if (!request.isHandled()) handle(target, request, request, response); } else handle(target, request, request, response); if (LOG.isDebugEnabled()) LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); }
public void handle(AbstractHttpConnection connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) { LOG.debug("REQUEST "+target+" on "+connection); handle(target, request, request, response); LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); } else handle(target, request, request, response); }
public void handle(HttpChannel<?> connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) LOG.debug("REQUEST "+target+" on "+connection); if ("*".equals(target)) { handleOptions(request,response); if (!request.isHandled()) handle(target, request, request, response); } else handle(target, request, request, response); if (LOG.isDebugEnabled()) LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); }
public void handle(AbstractHttpConnection connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) { LOG.debug("REQUEST "+target+" on "+connection); handle(target, request, request, response); LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); } else handle(target, request, request, response); }
public void handle(HttpChannel<?> connection) throws IOException, ServletException { final String target=connection.getRequest().getPathInfo(); final Request request=connection.getRequest(); final Response response=connection.getResponse(); if (LOG.isDebugEnabled()) LOG.debug(request.getDispatcherType()+" "+request.getMethod()+" "+target+" on "+connection); if (HttpMethod.OPTIONS.is(request.getMethod()) || "*".equals(target)) { if (!HttpMethod.OPTIONS.is(request.getMethod())) response.sendError(HttpStatus.BAD_REQUEST_400); handleOptions(request,response); if (!request.isHandled()) handle(target, request, request, response); } else handle(target, request, request, response); if (LOG.isDebugEnabled()) LOG.debug("RESPONSE "+target+" "+connection.getResponse().getStatus()+" handled="+request.isHandled()); }