Class ManagedServletPipeline

java.lang.Object
com.google.inject.servlet.ManagedServletPipeline

class ManagedServletPipeline extends Object
A wrapping dispatcher for servlets, in much the same way as ManagedFilterPipeline is for filters.
  • Field Details

    • servletDefinitions

      private final ServletDefinition[] servletDefinitions
    • SERVLET_DEFS

      private static final TypeLiteral<ServletDefinition> SERVLET_DEFS
    • REQUEST_DISPATCHER_REQUEST

      public static final String REQUEST_DISPATCHER_REQUEST
      A Marker constant attribute that when present in the request indicates to Guice servlet that this request has been generated by a request dispatcher rather than the servlet pipeline. In accordance with section 8.4.2 of the Servlet 2.4 specification.
      See Also:
  • Constructor Details

    • ManagedServletPipeline

      @Inject public ManagedServletPipeline(Injector injector)
  • Method Details

    • hasServletsMapped

      boolean hasServletsMapped()
    • collectServletDefinitions

      private ServletDefinition[] collectServletDefinitions(Injector injector)
      Introspects the injector and collects all instances of bound List<ServletDefinition> into a master list.

      We have a guarantee that Injector.getBindings() returns a map that preserves insertion order in entry-set iterators.

    • init

      public void init(javax.servlet.ServletContext servletContext, Injector injector) throws javax.servlet.ServletException
      Throws:
      javax.servlet.ServletException
    • service

      public boolean service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws IOException, javax.servlet.ServletException
      Throws:
      IOException
      javax.servlet.ServletException
    • destroy

      public void destroy()
    • getRequestDispatcher

      javax.servlet.RequestDispatcher getRequestDispatcher(String path)
      Returns:
      Returns a request dispatcher wrapped with a servlet mapped to the given path or null if no mapping was found.
    • wrapRequest

      static javax.servlet.http.HttpServletRequest wrapRequest(javax.servlet.http.HttpServletRequest request, String newUri)