UI-Component Sets
Project Documentation

Myfaces Core 2.0 on Google App Engine

In order to run Myfaces on Google App Engine, you need to complete the steps below. Configuration explained in this document is tested with Google App Engine 1.3.0.

You can also find tutorials for Eclipse and IntelliJ IDEA.

  • Download a Myfaces Core 2.0.0-beta-3 or a version released later than 2.0.0-beta-3. Google App Engine support is not available for older versions. Extract and put following files into war/WEB-INF/lib:
    • myfaces-api-2.0.x.jar
    • myfaces-impl-2.0.x.jar
    • commons-beanutils-1.x.x.jar
    • commons-codec-1.x.jar
    • commons-collections-3.x.jar
    • commons-digester-x.x.jar
    • commons-discovery-0.x.jar
    • commons-logging-1.x.x.jar
  • Add following lines into your web.xml.
               We need to set annotation lifecycyle provider manually as org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider.
               Other providers use some classes that are restricted on Google App Engine.   
                Need to set a secret to avoid javax.crypto.BadPaddingException.
                "param-value" must be Base64 encoded.
                More details: http://wiki.apache.org/myfaces/Secure_Your_Application
               Facelets configuration fragment
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-name>Faces Servlet</servlet-name>
  • Enable sessions on App Engine. To do this, add line below to war/WEB-INF/appengine-web.xml.
  • Although Google App Engine is said to support JSP 2.1, JSP implementation version(2.0) does not match JSP API version(2.1). So, we need to supply Unified Expression Language implementation jars. You can find them here. Put el-api-1.x.jar and el-impl-1.x.jar into war/WEB-INF/lib.
  • If you have a faces-config.xml, please check that you use the header for JSF2:
            <?xml version="1.0" encoding="UTF-8"?>
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
  • Here is the sample directory structure:
       +<Your Google App Engine Project Folder>
         + src
           + META-INF
             - jdoconfig.xml
         + war
           - somepage.xhtml
           + WEB-INF
             - appengine-web.xml
             - faces-config.xml
             - logging.properties
             - web.xml
             + lib
               - appengine-api-1.0-sdk-1.3.0.jar
               - appengine-api-labs-1.3.0.jar
               - commons-beanutils-1.7.0.jar
               - commons-codec-1.3.jar
               - commons-collections-3.2.jar
               - commons-digester-1.8.jar
               - commons-discovery-0.4.jar
               - commons-logging-1.1.1.jar
               - datanucleus-appengine-
               - datanucleus-core-1.1.5.jar
               - datanucleus-jpa-1.1.5.jar
               - el-api-1.1.jar
               - el-impl-1.1.jar
               - geronimo-jpa_3.0_spec-1.1.1.jar
               - geronimo-jta_1.1_spec-1.1.1.jar
               - jdo2-api-2.3-eb.jar
               - myfaces-api-2.0.0-beta-3.jar 
               - myfaces-impl-2.0.0-beta-3.jar