Class URITemplateProxyServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class URITemplateProxyServlet
    extends ProxyServlet
    A proxy servlet in which the target URI is templated from incoming request parameters. The format adheres to the URI Template RFC, "Level 1". Example:
       targetUri = http://{host}:{port}/{path}
     
    --which has the template variables. The incoming request must contain query args of these names. They are removed when the request is sent to the target.
    See Also:
    Serialized Form
    • Field Detail

      • TEMPLATE_PATTERN

        protected static final Pattern TEMPLATE_PATTERN
      • targetUriTemplate

        protected String targetUriTemplate
    • Constructor Detail

      • URITemplateProxyServlet

        public URITemplateProxyServlet()
    • Method Detail

      • initTarget

        protected void initTarget()
                           throws javax.servlet.ServletException
        Overrides:
        initTarget in class ProxyServlet
        Throws:
        javax.servlet.ServletException
      • service

        protected void service​(javax.servlet.http.HttpServletRequest servletRequest,
                               javax.servlet.http.HttpServletResponse servletResponse)
                        throws javax.servlet.ServletException,
                               IOException
        Overrides:
        service in class ProxyServlet
        Throws:
        javax.servlet.ServletException
        IOException