com.google.inject.servlet
Class GuiceFilter
java.lang.Object
com.google.inject.servlet.GuiceFilter
public class GuiceFilter
- extends Object
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
.
Method Summary |
void |
destroy()
|
void |
doFilter(ServletRequest servletRequest,
ServletResponse servletResponse,
FilterChain filterChain)
|
void |
init(FilterConfig filterConfig)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GuiceFilter
public GuiceFilter()
doFilter
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse,
FilterChain filterChain)
throws IOException,
ServletException
- Throws:
IOException
ServletException
init
public void init(FilterConfig filterConfig)
throws ServletException
- Throws:
ServletException
destroy
public void destroy()
Copyright 2009 Google Inc. All Rights Reserved.