|
Inhaltsverzeichnis
Zuletzt aktualisiert
|
Table Of Content
JavaServerFaces Frameworks1. Introduction1.1. JavaServerFacesJavaServerFaces (JSF) is a web application framework which provides prewritten items for a GUI. The offered components improves the quality and speed of creating websites without the need to know what is going on in the background of this code. 1.2. Tips for Installation under WindowsGenerally you should try to find a WAR for each framework. Now I would like to show you a way how to enable and disable a webproject under tomcat again. First of all download and install Tomcat to a directory of your choice. To seperate Tomcat and the root-directory where all JSP will be placed create a directory like c:/jsf-root/. So open the file {TOMCAT_DIR}/conf/server.xml and scroll down until you reach </Host>. e.g.: <Context docBase="c:/jsf-root/myfaces" path="/myfaces" /> For each projects you can add a new <Context> to enable it or you can comment it out with <!-- <Context ... /> -->. Finally you can start your Tomcat by running {TOMCAT_DIR}/bin/startup.bat. Links: 1.3. Installing application using a WARIf you found a WAR from a framework you got luck. The installation is very easy and you do not have to edit any configuration file. Now you can start your browser and type the URL: http://localhost:8080/{NAME_OF_WARFILE}
e.g. adf-faces-demo-ea20-SNAPSHOT.war http://localhost:8080/adf-faces-demo-ea20-SNAPSHOT/ 1.4. Installing application without WARIf you are not able to find any WAR for your framework then it can be quite difficult.
2. Popular Frameworks in Detail2.1. myFaces
2.1.1. DescriptionApache MyFaces is the first free open source Java Server Faces (JSF) implementation. JSF is a web application framework in Java which can be used to create prewritten items in websites without coding a lot. 2.1.2. Analysis
2.1.3. SummaryLinksWebsite: http://myfaces.apache.org/ Demo: http://www.irian.at/myfaces/home.jsf WAR: http://archive.apache.org/dist/myfaces/binaries/myfaces-1.1.1-examples.zip (simple.war) Tutorial: http://www.heise.de/ix/artikel/2006/04/136/ TLD: http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/index.html Tags<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> Libraries
2.2. Tomahawk
2.2.1. DescriptionTomahawk is a JSF implementation based on MyFaces. 2.2.2. Analysis
2.2.3. SummaryLinksWeb: http://myfaces.apache.org/tomahawk/index.html Download: http://www.apache.org/dyn/closer.cgi/myfaces/binaries/myfaces-core-1.1.3-bin.tar.gz http://www.apache.org/dyn/closer.cgi/myfaces/binaries/tomahawk-1.1.2-bin.tar.gz WAR: http://archive.apache.org/dist/myfaces/binaries/myfaces-1.1.1-examples.zip (simple.war) JavaDoc: http://myfaces.apache.org/tomahawk/apidocs/index.html TLD: http://myfaces.apache.org/tomahawk/tlddoc/index.html TLD Core: http://myfaces.apache.org/impl/tlddoc/index.html Tags
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
Libraries
Used frameworksKupu: http://kupu.oscom.org/demo/ 2.3. Sandbox
2.3.1. DescriptionSandbox is an additional framework which has a relationship to Tomahawk. During the last time a lot of new objects were published in Sandbox and the community grows. 2.3.2. Analysis
2.3.3. SummaryLinksWebsite: http://myfaces.apache.org/sandbox/index.html Demo: http://www.irian.at/myfaces-sandbox/home.jsf WAR: http://archive.apache.org/dist/myfaces/binaries/myfaces-1.1.1-examples.zip (sandbox.war) Tags
<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
Libraries
Used frameworks2.4. Tobago
2.4.1. DescriptionThe developement of this framework started in 2002 and was designed for using different themes without changing the own JSP. 2.4.2. Analysis
2.4.3. SummaryLinksWeb: http://myfaces.apache.org/tobago/index.html Demo: http://tobago.atanion.net/tobago-example-demo/faces/overview/intro.jsp Download: http://www.apache.org/dyn/closer.cgi/myfaces/binaries/myfaces-tobago-1.0.7-bin.tar.gz WAR: - Installation: http://myfaces.apache.org/tobago/getting-started.html Tags<%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %> <%@ taglib uri="http://myfaces.apache.org/tobago/facelet-extension" prefix="tx" %> Libraries
2.4.4. InstallationI was not able to get the current binary distribution running without errors. So I choose another way to install Tobago. and a SVN client like TortoiseSVN: At the beginning check out the sources of Tobago:
svn checkout http://svn.apache.org/repos/asf/myfaces/tobago/trunk/ tobago
In TortoiseSVN: After downloading change into the main directory and type: mvn install This proccess takes a while because Maven downloads all needed frameworks and compiles the sources of Tobago. If you see an error message like this: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: org.apache.maven:maven-model Reason: Error getting POM for 'org.apache.maven:maven-model' from the repository : Error transferring file org.apache.maven:maven-model:pom:2.0 from the specified remote repositories: central (http://repo1.maven.org/maven2), apache.snapshots (http://svn.apache.org/maven-snapshot-repository), snapshots (http://snapshots.maven.codehaus.org/maven2) [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 51 seconds [INFO] Finished at: Mon Jun 12 14:16:28 CEST 2006 [INFO] Final Memory: 4M/7M [INFO] ------------------------------------------------------------------------ Just ignore it and run mvn install once again until all files are downloaded. In the end change into the demo directory example/demo and run
mvn package
A nice WAR will be built and this is exactly what we want to have. 2.5. Trinidad (ADF)
2.5.1. DescriptionTrinidad formerly known as Abstract Design Framework (ADF) is supported and developed by the help of Oracle. 2.5.2. Analysis
2.5.3. SummaryLinksTutorial: http://www.oracle.com/technology/products/adf/learnadf.html http://www.oracle.com/technology/products/jdev/101/howtos/adfskins/index.html Download: http://www.oracle.com/technology/products/jdev/howtos/10g/adfjsf/how-to-adf-faces-10gjdev.htm (I have been using the adf-faces-demo-ea20-SNAPSHOT.war from Tom, should be the same like on this link) http://www.oracle.com/technology/products/adf/index.html (is part of the Oracle JDeveloper 10g) Tags<%@ taglib prefix="af" uri="http://xmlns.oracle.com/adf/faces" %> <%@ taglib prefix="afh" uri="http://xmlns.oracle.com/adf/faces/html" %> Libraries
2.6. ZK1 / ZK2
2.6.1. DescriptionZK is the most active project on SourceForge.net. 2.6.2. Analysis
2.6.3. SummaryLinksWebsite: http://zk1.sourceforge.net/ Demo: http://www.potix.com/zkdemo/userguide Download: http://sourceforge.net/project/showfiles.php?group_id=152762 WAR: http://sourceforge.net/project/showfiles.php?group_id=152762 (demo/bin/zkdemo.war) API: http://zk1.sourceforge.net/javadoc/index.html Commercial Licence: http://zk1.sourceforge.net/buy/pricing.html TagsNone... ZK uses ZUL instead of JSP. Used frameworks2.7. ICEfaces
2.7.1. DescriptionThe Company ICESoft is responsible for this application framework which has its focus especially on AJAX and the communication between server and client. 2.7.2. Analysis
2.7.3. SummaryLinksWebsite: http://www.icesoft.com/products/demos_icefaces.html Demo: http://demo.icesoft.com/component-showcase/ WAR: http://www.icesoft.com/downloads/reg.php?id=1 (samples/component-showcase.war) Tags<%@ taglib prefix="ice" uri="http://www.icesoft.com/icefaces/component" %> Libraries
Used frameworkshttp://script.aculo.us http://mir.aculo.us 2.8. NetAdvantage
2.8.1. Description2.8.2. Analysis
2.8.3. SummaryLinksWebsite: http://www.infragistics.com/products/NetAdvantage/JSF/ Download: http://www.infragistics.com/downloads/details.aspx?productid=134 WAR: http://www.infragistics.com/downloads/details.aspx?productid=134 (demos/war/j2ee.1.4/infragistics-netadvantage.war) Tags<%@ taglib prefix="ig" uri="http://www.infragistics.com/faces/netadvantage"%> Libraries
3. Comparison between different frameworks3.1. Overview
3.2. Further information
4. Using a JSF framework in a hybris extension4.1. Create a new extension using extgenIt is not that difficult to combine JSF and a self-made extension for the hybris platform. Now it is time to show you a small example using one of the listed frameworks above. 4.2. Setting up the libraries
4.3. Build up the structure
index.jsp: <html> <head> <title>NetAdvantage: Example </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="refresh" content="0; URL=index2.faces"> </head> <body> <p>Loading...</p> </body> </html>
4.4. Configure JSP for our hybris platform
<%@ include file="head.inc" %>
Now the beginning should look like this: ... <%@ page contentType="text/html" language="java"%> <%@ include file="head.inc" %> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib prefix="ig" uri="http://www.infragistics.com/faces/netadvantage"%> ... At the end of this file add one last line to cleanup the JaloSession which has been created from head.inc:
<%@ include file="foot.inc" %>
<% JaloSession.deactivate(); %> 4.5. Set a filter to prevent JaloSession errors with Ajax-RequestsSometimes we get an internal server error as a page during some requests with Ajax: 500 Internal Server Error javax.faces.el.EvaluationException: de.hybris.jakarta.jalo.JaloSystemException: JaloSession.getCurrentSession(): No current session available. To activate a session use session.activate(). The message occurs when trying to use a JaloSession at this website before the head.inc could be included.
<!-- filters --> <filter> <filter-name>initfilter</filter-name> <filter-class>ybluestorepackage.filter.YBluestoreInitFilter</filter-class> </filter> <!-- filter mappings --> <filter-mapping> <filter-name>initfilter</filter-name> <url-pattern>*.faces</url-pattern> </filter-mapping> After inserting this code we need of course the depending filter.
Now we got everything we need to launch our application! 4.6. Run our extension
http://localhost:9001/{YOUR_EXTENSION}
5. Other frameworks5.1. Ajax4jsf
An Open Source Framework that enables AJAX in JSF Applications. Web: https://ajax4jsf.dev.java.net/ Demo: http://livedemo.exadel.com/vcpDemo/demo.jsf This framework offers only simple objects and requests.
5.2. Eba's AJAX JSF component library
Eba has one single Combobox. Web: http://labs.ebusiness-apps.com/wiki/default.asp?AjaxJsfComponents 5.3. Rialto JSF
JSF encapsulation of Rialto.
Web: http://rialto.application-servers.com/wiki/jsf Demo: http://rialto.application-servers.com/NewsReaderPHP/index.php http://rialto.application-servers.com/NewsReaderJSF 5.4. WebGalileo Faces
Customizable reusable user interface components with support for JSF. Uses:
WebGalileo Faces is slow and contains only a few components which use Ajax. Web: http://www.jscape.com/webgalileofaces/ Demo: http://jscape.webappcabaret.net/webgalileofaces/ 5.5. Xulfaces
Web: http://xulfaces.sourceforge.net/ Demo: http://xulfaces.sourceforge.net/live-demo.html WAR: http://sourceforge.net/projects/xulfaces 5.6. Backbase AJAX Java Edition
Introduces a AJAX-based single page interface to JSF.
Nice componenents which try to emulate a desktop with a taskbar, icons and Windows. Web: http://www.backbase.com/#home/products/editions/java_edition.xml |














Kommentar hinzufügen