14Google App Engine
Starting a new project
Due to security restrictions on Google App Engine's sandbox, some of VRaptor3's components must be replaced, and a different selection of dependencies must be used. A version of the blank project featuring these modifications is available at our download page.
Configuration
To enable VRaptor components replaced to Google App Engine, you need add the lines bellow in your web.xml:
<context-param>
<param-name>br.com.caelum.vraptor.packages</param-name>
<param-value>br.com.caelum.vraptor.gae</param-value>
</context-param>
Limitations
A relevant detais is that the dependency injection does not work when redirecting from one logic to another; the controller is instantiated by filling with null all of its arguments. This said, one should avoid call like:
result.use(Results.logic()).redirectTo(SomeController.class).someMethod();
validator.onErrorUse(Results.logic()).of(SomeController.class).someMethod();
using, instead, Results.page(). An alternative would be to prepare your controllers to expect null as construction arguments.
Troubleshooting
App Engine's execution environment nor does enable support for Expression Language by default, nor supports the
<%@ page isELIgnored="false" %>
For tag files, use:
<%@ tag isELIgnored="false" %>
JPA 2
VRaptor supports JPA versions 1 and 2, but Google App Engine only supports JPA 1. Therefore you should avoid copying the jpa-api-2.0.jar file to your project.