public class ObjectifyFilter extends AbstractFilter
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.
Constructor and Description |
---|
ObjectifyFilter() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
destroy, init
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
Copyright © 2016. All rights reserved.