MyFaces 2.0 on GAE
Posted in AppEngine on April 1st, 2010 – Be the first to commentThis post describes steps to deploy JSF 2.0 application to GAE.
I use MyFaces version 2.0.0 beta 3 for this purpose.
Required jars
- Download MyFaces binary from MyFaces download page.
- Extract and copy all jars to WEB-INF/lib
- Download Tomcat 6 from Tomcat download page (We need EL jars)
- Extract and copy el-api.jar and jasper-el.jar to WEB-INF/lib
The web.xml file
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<context-param>
<param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
<param-value>org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
Test index.xhtml page
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head><title>JSF 2.0: Test page</title></h:head> <h:body> <div align="center">This is test page for JSF 2.0 on GAE</div> </h:body> </html>
Deploy and run
Deploy app to GAE and open http://appid.appspot.com/index.jsf
You shoud see message
This is test page for JSF 2.0 on GAE.
in your browser.
That’s it.
Leave a Comment »

