Installation and Configuration |
||||||||||||||||||||||||||||||||||||||||||
Developer’s Guide Home
Installation and Configuration Common Concepts Components Index Border Layout Panel Calendar Chart Command Button Command Link Confirmation Data Table Date Chooser Day Table Drop Down Field Dynamic Image Folding Panel For Each Graphic Text Hint Label Input Text Input Textarea Layered Pane Popup Layer Popup Menu Select Boolean Checkbox Select Many Checkbox Select One Radio Spinner Suggestion Field Tabbed Pane Tab Set Tree Table Two List Selection Window Focus Load Bundle Scroll Position Ajax Framework Validation Framework Tag Reference API Reference |
InstallationProvided that you already have a JSF application, the following steps will allow you to use OpenFaces components in your application:
Using with MavenThe following repositories should be added to the <repositories> tag in your pom.xml file to make OpenFaces itself and its dependencies (such as JFreeChart) to be available: <repository> <id>org.openfaces</id> <url>http://repository.openfaces.org/repository</url> </repository> <repository> <id>jfree</id> <url>http://www.ibiblio.org/maven/jfree/</url> </repository> Here's a dependency for the OpenFaces library itself: <dependency> <groupId>org.openfaces</groupId> <artifactId>openfaces</artifactId> <version>2.0</version> <scope>compile</scope> </dependency> And here are the dependencies required for OpenFaces at runtime: <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>jdom</groupId> <artifactId>jdom</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>jfree</groupId> <artifactId>jcommon</artifactId> <version>1.0.16</version> </dependency> <dependency> <groupId>jfree</groupId> <artifactId>jfreechart</artifactId> <version>1.0.13</version> </dependency> Installation in JSR-168 Portlets EnvironmentTo use OpenFaces in Portlets environment, you should first make all necessary steps from the section Installation. To ensure that default styles of the OpenFaces components are correctly applied, the following CSS reference should be defined in the <head> tag of the HTML page: <link rel='stylesheet' type='text/css'
href='/<AppName>/openFacesResources/org/openfaces/renderkit/default.css'/>
where <AppName> is a Portlet context path. Note If you use OpenFaces in JBoss Portal Server, you should specify the following portlet class in the WEB-INF/portelt.xml file: <portlet-class>org.openfaces.portlet.OpenFacesPortlet</portlet-class> This portlet class should be specified for both JSF implemenetations: MyFaces and Sun reference implementation. Please note that org.openfaces.portlet.OpenFacesPortlet class should be used instead of org.apache.myfaces.portlet.MyFacesGenericPortlet or com.sun.faces.portlet.FacesPortlet class, not in addition to it. Please also note that if you use Sun Reference implementation, you still have to place JSF portlet bridge (jsf-portlet.jar) to your portlet. Third-Party LibrariesThe OpenFaces library uses software developed by the JDOM Project, JFreeChart library, JCommon class library, CSS Parser library and parts of code from Apache MyFaces Project, Apache Commons codec and JSON software. RedistributionWhen distributing your application, please make sure to:
Using OpenFaces LibraryTo use components of the OpenFaces library, you should declare "http://openfaces.org/" namespace with "o" prefix. To do it, add the following piece of code to the JSP application: <%@taglib uri="http://openfaces.org/" prefix="o" %>
Or add the following parameter to the <HTML> tag to the Facelets application: xmlns:o="http://openfaces.org/"
Application Context ParametersAll application context parameters are summarized in the following table:
Resource Filter OptimizationTo improve performance, you can reduce the scope of requests that are handled by OpenFaces Resource Filter. For example, you can use the following ResourceFilter mappings in your web.xml: <!-- MAPPING FOR OPENFACES COMPONENTS FILTER --> <filter-mapping> <filter-name>ResourceFilter</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <filter-mapping> <filter-name>ResourceFilter</filter-name> <url-pattern>/openFacesResources/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> Running Application in WebSphere Application ServerWebSphere 6.1To run the application with OpenFaces in WebSphere 6.1, update WebSphere to version 6.1.0.7. Also, make sure that the com.ibm.ws.webcontainer.invokefilterscompatibility property is set to "true". You can do this in the Custom Properties form (Application Servers -> <server> -> Web Container Settings -> Web Container -> Custom Properties). Once set, you should not change this custom property even if you upgrade the WebSphere Application Server. Then, follow these steps to run your OpenFaces application:
WebSphere 6.0To run the application with OpenFaces in WebSphere 6.0, update WebSphere to version 6.0.2.17. Then, follow these steps:
Setting Up a Local Copy of OpenFaces Demo ApplicationThe binary and source distribution of OpenFaces demo application can be found in the OpenFaces downloads page. There are two versions of the demo, both having the same functionality but based on different view technologies: the Facelets-based, and the JSP-based one. The demo package is bundled with JSF RI 1.2 (aka Mojarra 1.2). OpenFaces demo can run on Tomcat 6.0 application server without any changes. Running on other servers might require a different set of libraries and appropriate changes in web.xml (this mostly concerns the cases when other JSF implementation is bundled with a particular server). To run OpenFaces demo on the local machine, follow these steps:
|
|||||||||||||||||||||||||||||||||||||||||
© 2009 TeamDev Ltd. | ![]() |