JSF (MyFaces) in Google App Engine for Java - First Test

1) Download MyFaces implementation of JSF 1.1
http://myfaces.apache.org/download.html

2) Copy necessary jar from /lib to war/WEB-INF/lib of your google app
engine project (I'm using Eclipse+Google Plugin for Eclipse)

3) Edit war/WEB-INF/web.xml with necessary Faces servlet

<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>

4) Enable session on appengine-web.xml

<sessions-enabled>true</sessions-enabled>

5) Create a test.jsp on /war war folder and add at the top necessary
taglib import directive

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

and a simple jsf test

<f:view>
<h:outputText value="Hello Word in JSF"></h:outputText>
</f:view>

Commenti

Post popolari in questo blog

Eclipse underscore not visible

Batch Convert CSV to XLSX with LibreOffice (OpenOffice)