Package org.eclipse.jetty.servlets

Examples of org.eclipse.jetty.servlets.ProxyServlet


  /**
   * @return true if the request was served.
   */
  private boolean proxyRemoteUrl(HttpServletRequest req, HttpServletResponse resp, final URL mappedURL, boolean failEarlyOn404) throws IOException, ServletException, UnknownHostException {
    ProxyServlet proxy = new RemoteURLProxyServlet(mappedURL, failEarlyOn404);
    proxy.init(getServletConfig());
    try {
      // TODO: May want to avoid console noise from 4xx response codes?
      traceRequest(req);
      try {
        proxy.service(req, resp);
      } catch (NotFoundException ex) {
        // This exception is only thrown in the "fail early on 404" case, in which case
        // no output was written and we didn't serve the request.
        return false;
      }
    } finally {
      proxy.destroy();
    }
    // We served this request
    return true;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.servlets.ProxyServlet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.