Class ProxyFilter

  • All Implemented Interfaces:
    javax.servlet.Filter, RequestHandlerRegistry

    public class ProxyFilter
    extends Object
    implements javax.servlet.Filter, RequestHandlerRegistry
    The Apache Felix Http Bridge requires a Http Proxy on the SErvlet Container (Jetty) Side in order to work properly. The default implementation uses the ProxyServlet. However, this only forwards requests to a certain context, e.g. /osgi. This breaks with a lot of components, e.g. Vaadin is required to be exposed to /VAADIN In order to compensate, a Filter is used instead, which forwards to the HttpServlet of the Apache Felix Http Bridge. To only forward/dispatch requests which can actually be handled by OSGi-registered Servlets, all registered Servlet's are persisted here.
    Author:
    mvrueden
    • Constructor Detail

      • ProxyFilter

        public ProxyFilter()
    • Method Detail

      • init

        public void init​(javax.servlet.FilterConfig filterConfig)
                  throws javax.servlet.ServletException
        Specified by:
        init in interface javax.servlet.Filter
        Throws:
        javax.servlet.ServletException
      • doFilter

        public void doFilter​(javax.servlet.ServletRequest request,
                             javax.servlet.ServletResponse response,
                             javax.servlet.FilterChain chain)
                      throws IOException,
                             javax.servlet.ServletException
        Specified by:
        doFilter in interface javax.servlet.Filter
        Throws:
        IOException
        javax.servlet.ServletException
      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Filter