//This example is from Jakub Czeczotka
//web.xml
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
HelloWorldJSF
Hello in the JavaServer Faces World!
org.apache.myfaces.webapp.StartupServletContextListener
Faces Servlet
javax.faces.webapp.FacesServlet
1
Faces Servlet
*.jsf
index.jsp
//faces-config.xml
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
helloWorldBean
eu.czeczotka.HelloWorldBean
session
//HelloWorldBean.java
package eu.czeczotka;
/**
* Sample bean for the HelloWorldJSF project
*
* @author Jakub Czeczotka
*/
public class HelloWorldBean {
private String hello = "Hello in the JavaServer Faces World!";
public String getHello () {
return this.hello;
}
}
//helloworld.jsp
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%-- HelloWorldJSF - author Jakub Czeczotka --%>
HelloWorldJSF
//index.jsp
<% response.sendRedirect("helloworld.jsf"); %>
HelloWorldJSF.zip( 2,263 k)