Package com.google.inject.servlet
package com.google.inject.servlet
Servlet API scopes, bindings and registration; this extension requires
guice-servlet.jar
.
Apply GuiceFilter
to any servlets which will use the servlet
scopes. Install ServletModule
into your Injector
to install everything at once.
-
ClassDescriptionAbstract implementation for all servlet module bindingsA wrapper for requests that makes requests immutable, taking a snapshot of the original request.This default pipeline simply dispatches to web.xml's servlet pipeline.A Filter chain impl which basically passes itself to the "current" filter and iterates the chain on
doFilter()
.An internal representation of a filter definition against a particular URI pattern.An internal dispatcher for guice-servlet registered servlets and filters.Builds the guice module that binds configured filters, with their wrapper FilterDefinitions.Apply this filter in web.xml above all other filters (typically), to all requests where you plan to use servlet scopes.As of Guice 2.0 you can still use (your subclasses of)GuiceServletContextListener
class as a logical place to create and configure your injector.A binding to a single instance of a filter.Default implementation of InstanceFilterBinding.A binding to a single instance of a servlet.Default implementation of InstanceServletBinding.This is a left-factoring of all ServletModules installed in the system.Special Provider that tries to obtain an injected servlet context, specific to the current injector, failing which, it falls back to the static singleton instance that is available in the legacy Guice Servlet.A linked binding to a filter.Default implementation of LinkedFilterBinding.A linked binding to a servlet.Default implementation of LinkedServletBinding.Central routing/dispatch class handles lifecycle of managed filters, and delegates to the servlet pipeline.A wrapping dispatcher for servlets, in much the same way asManagedFilterPipeline
is for filters.Apply this to field or parameters of typeMap<String, String[]>
when you want the HTTP request parameter map to be injected.Apply this to implementation classes when you want one instance per request.Object that can be used to apply a request scope to a block of code.Closeable subclass that does not throw any exceptions from close.Exception thrown when there was a failure entering request scope.Annotates aGuiceFilter
that provides scope functionality, but doesn't dispatch toServletModule
bound servlets or filters.An internal representation of a servlet definition mapped to a particular URI pattern.Configures the servlet scopes and creates bindings for the servlet API objects so you can inject the request, response, session, etc.See the EDSL examples atServletModule.configureServlets()
See the EDSL examples atServletModule.configureServlets()
A binding created byServletModule
.A visitor for the servlet extension.Servlet scopes.A sentinel attribute value representing null.Builds the guice module that binds configured servlets, with their wrapper ServletDefinitions.Some servlet utility methods.Accumulates byte sequences while decoding strings, and encodes them into a StringBuilder.Apply this to implementation classes when you want one instance per session.A general interface for matching a URI against a URI pattern.An enumeration of the available URI-pattern matching stylesMatches URIs using a regular expression.Matches URIs using the pattern grammar of the Servlet API and web.xml.