Package com.google.inject.servlet
Class ManagedServletPipeline
- java.lang.Object
-
- com.google.inject.servlet.ManagedServletPipeline
-
class ManagedServletPipeline extends java.lang.Object
A wrapping dispatcher for servlets, in much the same way asManagedFilterPipeline
is for filters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ManagedServletPipeline.RequestDispatcherRequestWrapper
-
Field Summary
Fields Modifier and Type Field Description static java.lang.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.private static TypeLiteral<ServletDefinition>
SERVLET_DEFS
private ServletDefinition[]
servletDefinitions
-
Constructor Summary
Constructors Constructor Description ManagedServletPipeline(Injector injector)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private ServletDefinition[]
collectServletDefinitions(Injector injector)
Introspects the injector and collects all instances of boundList<ServletDefinition>
into a master list.void
destroy()
(package private) javax.servlet.RequestDispatcher
getRequestDispatcher(java.lang.String path)
(package private) boolean
hasServletsMapped()
void
init(javax.servlet.ServletContext servletContext, Injector injector)
boolean
service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
(package private) static javax.servlet.http.HttpServletRequest
wrapRequest(javax.servlet.http.HttpServletRequest request, java.lang.String newUri)
-
-
-
Field Detail
-
servletDefinitions
private final ServletDefinition[] servletDefinitions
-
SERVLET_DEFS
private static final TypeLiteral<ServletDefinition> SERVLET_DEFS
-
REQUEST_DISPATCHER_REQUEST
public static final java.lang.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:
- Constant Field Values
-
-
Method Detail
-
hasServletsMapped
boolean hasServletsMapped()
-
collectServletDefinitions
private ServletDefinition[] collectServletDefinitions(Injector injector)
Introspects the injector and collects all instances of boundList<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 java.io.IOException, javax.servlet.ServletException
- Throws:
java.io.IOException
javax.servlet.ServletException
-
destroy
public void destroy()
-
getRequestDispatcher
javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.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, java.lang.String newUri)
-
-