public class

GuiceFilter

extends Object
java.lang.Object
   ↳ com.google.inject.servlet.GuiceFilter

Class Overview

Apply this filter in web.xml above all other filters (typically), to all requests where you plan to use servlet scopes. This is also needed in order to dispatch requests to injectable filters and servlets:

  <filter>
    <filter-name>guiceFilter</filter-name>
    <filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>guiceFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  
This filter must appear before every filter that makes use of Guice injection or servlet scopes functionality. Typically, you will only register this filter in web.xml and register any other filters (and servlets) using a ServletModule.

Summary

Public Constructors
GuiceFilter()
Public Methods
void destroy()
void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
void init(FilterConfig filterConfig)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GuiceFilter ()

Public Methods

public void destroy ()

public void doFilter (ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)

Throws
IOException
ServletException

public void init (FilterConfig filterConfig)

Throws
ServletException