Package com.googlecode.objectify
Class ObjectifyFilter
java.lang.Object
com.googlecode.objectify.util.AbstractFilter
com.googlecode.objectify.ObjectifyFilter
- All Implemented Interfaces:
javax.servlet.Filter
Configure this filter to use Objectify in your application. It works in concert with
ObjectifyService
to provide the correct Objectify
instance when ObjectifyService.ofy()
is called.
In your web.xml:
<filter> <filter-name>ObjectifyFilter</filter-name> <filter-class>com.googlecode.objectify.ObjectifyFilter</filter-class> </filter> <filter-mapping> <filter-name>ObjectifyFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>Or, if you use Guice:
filter("/*").through(ObjectifyFilter.class);
If you use the Objectify outside of the context of a request (say, using the remote API or from a unit test), then you should use the ObjectifyService.run() method.
- Author:
- Jeff Schnitzer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doFilter
(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) Methods inherited from class com.googlecode.objectify.util.AbstractFilter
destroy, init
-
Constructor Details
-
ObjectifyFilter
public ObjectifyFilter()
-
-
Method Details
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException - Throws:
IOException
javax.servlet.ServletException
-