MyFaces - open jsf

来源:百度文库 编辑:神马文学网 时间:2024/03/29 23:53:08

Last Published: 07/18/2007
Apache|MyFaces|API|Impl|Tomahawk|Sandbox|Tobago|Trinidad|Orchestra
Apache MyFaces
News archive
Download
Mailing Lists
MyFaces Projects
Overview
API
Impl
Tomahawk
Sandbox
Tobago
Trinidad
Orchestra
Documentation
Getting Started
MyFaces and RI
FAQ
Javadoc
Wiki
Compatibility
Tomcat Configuration
Project Documentation
Project Information

Examples Application
Your first step with Apache MyFaces should be to havea look at our examples application. You can do thatby going to our working distribution onhttp://www.irian.at/myfaces.jsfor by deploying the examples application yourself. Allyou need to do to get up and running is to follow the steps below!
What you need for the Examples Application
Tomcat 5.x. Downloadhere.
MyFaces examples. Latest milestone webapp archive (myfaces-X.X.X-examples.zip or myfaces-X.X.X-examples.tgz) ishere.
Installing and Running the Examples
Unpack the MyFaces examples archive myfaces-X.X.X-examples.zip (or myfaces-X.X.X-examples.tgz) to a directory of your choice.
Remove any previous MyFaces webapps from your Tomcat installation and clean up your Tomcat work dir. Also make sure that there is no jsf-api.jar or jsf-impl.jar (i.e. Suns API and implementation) in the classpath or in one of Tomcat‘s lib directories (common/lib or shared/lib).
Copy the file simple.war (or any of the other example war-files) to the webapps dir of your Tomcat installation directory - and check once more that there is no old myfaces-examples directory there ;-)
Start Tomcat, if its not already running.
Start your browser and enjoy it athttp://localhost:8080/simple
Installing and Running Sun JSF-RI Samples with MyFaces
see detailed description
Using MyFaces in your own web application
Suggested step: Look at thecompatibility list to find out if your servlet container is supported.
There are two possible ways to start off with MyFaces, one is to start from the example-app: If you want to have it simple, take the myfaces-X.X.X-examples.zip you downloaded before for looking at the examples, and extract the blank.war file (MyFaces binary)
Rename the blank.war file to blank.zip, and extract this file - you have a working directory structure for a MyFaces application at hand after this step.
The second possibility is to downloadthe core implementation and/or tomahawk (dependent on if you want touse the RI and the tomahawk components, or only MyFaces), and startfrom there: Alternatively, download the latestMyFaces binary release. You can download only the implementation (aka core) or the implementation and tomahawk.
Copy all *.jar files into your WEB-INF/lib directory. Some of the jar-files are optional, you can find more info on:http://myfaces.apache.org/impl/dependencies.html andhttp://myfaces.apache.org/tomahawk/dependencies.html
After you have downloaded the necessary packages and setup your project hierarchy, do this: Make sure that there is no jsf-api.jar (i.e. Suns API implementation) in the classpath or in one of your container‘s shared lib directories (e.g. common/lib or shared/lib for Tomcat).
Configure your webapp‘s web.xml file (see conf/web.xml for example and documentation)
Add the following lines to your JSPs:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
Using the MyFaces extensions (aka Tomahawk) in your own web application
If you don‘t use the MyFaces implementation, you will need to add the file tomahawk.jar and its dependencies (see above) to your web-app directory.
To be able to use the MyFaces extensions (aka Tomahawk) add the following line to your JSPs:
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://myfaces.apache.org/wap" prefix="wap" %>
For using the Tomahawk components, it‘s also very important to setup the MyFaces Extensions-Filter. You find the explanations for doing this under:http://myfaces.apache.org/tomahawk/extensionsFilter.html
Tutorials for getting started with JSF
Core-Servlets JSF Tutorial by Marty Hall
©2007The Apache Software Foundation