• HOME
  • EMAIL US
  • 1.800.975.6814

@dailyrazor Blog

Oct
25
2012

ICEfaces JSF Hosting – How To Configure ICEfaces JSF Framework

Posted BY: Web Master | Comment: | Category:

ICEfaces is an open-source Rich Internet Application (RIA) development framework based on the JavaServer Faces 2 (JSF) standard. ICEfaces extends JavaServer Faces (JSF) to simplify development and enhance the standard JSF feature set – simultaneously improving developer efficiency and expanding the spectrum of RIA capabilities that can be included in any JSF-based web application. DailyRazor is a leading java hosting provider for ICEfaces hosting and JSF hosting. ICEfaces framework is supported and can be hosted on any of our Private Tomcat java hosting plans.

ICEfaces JSF Hosting Plans:

jsf hosting

How to Deploy ICEfaces on DailyRazor Servers:

Requirements:

  • Java 6 or above
  • Tomcat 6 or above

Steps for Private Tomcat plan owners:

  • 1. Open ICEfaces download page – http://www.icesoft.org/downloads/icefaces-downloads.jsf and download binary bundle for the stable release “ICEfaces-.zip” to your local computer. Download is available for registered users only so you will need to register first.
  • 2. Unpack downloaded file.
  • 3. Upload all jar libraries required by your app from lib/ subfolder under the folder where the archive was unpacked to, to Tomcat’s shared lib folder – /home/_username_/tomcat/shared/lib/ (where _username_ is name of your account on the server). Brief libraries description below:
  • icefaces.jar – This is the ICEfaces core framework and is required for all applications.
    icepush.jar – Provides Ajax Push functionality for ICEfaces. This library is only required if Ajax Push functionality is required in the application. See the Ajax Push overview, and API for details.
    icefaces-ace.jar – This library contain the ACE Components. You should include this library if you want to use latest ICEfaces components in your application.
    icefaces-compat.jar – This library contains the ICE Components (formerly known as the ICEfaces Component Suite in 1.x). You should include this library if you want to use the ICE Components in your application.
    jsf-api.jar and jsf-impl.jar – Must be included if the application server platform you plan to run on does not already supply them. For example, JEE6-compliant platforms such as Glassfish 3 and JBoss 7 already have the JSF 2 libraries provided, but servlet-containers such as Tomcat do not.

  • 4. After uploading all the files to Tomcat’s, please restart your Tomcat so it loads the libraries.
  • 5. Configure ICEfaces for your application (described below) and upload the application to the server, and Tomcat will deploy it automatically. You don’t need to include the libraries to application itself, Tomcat will share them for all the applications you Tomcat running.

Steps for Shared Tomcat plan owners:

  • 1. Open ICEfaces download page -http://www.icesoft.org/downloads/icefaces-downloads.jsf and download binary bundle for the stable release “ICEfaces-.zip” to your local computer. Download is available for registered users only so you will need to register first.
  • 2. Unpack downloaded file.
  • 3. Upload all jar libraries required by your app from lib/ subfolder under the folder where the archive was unpacked to, to application lib folder (WEB-INF/lib) on the local machine. Brief libraries description below:
  • icefaces.jar – This is the ICEfaces core framework and is required for all applications.
    icepush.jar – Provides Ajax Push functionality for ICEfaces. This library is only required if Ajax Push functionality is required in the application. See the Ajax Push overview, and API for details.
    icefaces-ace.jar – This library contain the ACE Components. You should include this library if you want to use latest ICEfaces components in your application.
    icefaces-compat.jar – This library contains the ICE Components (formerly known as the ICEfaces Component Suite in 1.x). You should include this library if you want to use the ICE Components in your application.
    jsf-api.jar and jsf-impl.jar – Must be included if the application server platform you plan to run on does not already supply them. For example, JEE6-compliant platforms such as Glassfish 3 and JBoss 7 already have the JSF 2 libraries provided, but servlet-containers such as Tomcat do not.

  • 4. In case if you prefer to use applications in .war format, repack updated application.
  • 5. Remove the application (war or folder with unpacked application) from the server, so Tomcat will undeploy it
  • 6. Upload the application to the server, so the Tomcat will automatically deploy it. Please note, you need to configure ICEfaces first, please check how to do this below.

Configuring ICEfaces:

  • 1. The ICEfaces core framework (icefaces.jar), ICEpush (icepush.jar), and ACE Components (icefaces-ace.jar) do not require any additional configuration beyond what JSF 2 requires.

    Simply ensure you have the FacesServlet is declared appropriately in your web.xml file:

    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    <url-pattern>/icefaces/*</url-pattern>
    </servlet-mapping>

    <!– More efficient, in an AJAX environment, to have server side state saving –>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>

    <!– HTML comments become components unless they’re stripped –>
    <context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
    </context-param>

  • 2. The ICE Components require additional configuration steps before they can be used in your application. Please refer to the official documentation for details.
  • 3. With ICEfaces there is no need for a faces-config.xml file, but if you are using one in your application or for your own components, remember to use the new schema for JSF 2:

    <faces-config
    xmlns=”http://java.sun.com/xml/ns/javaee”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd”
    version=”2.0″
    metadata-complete=”false”>

    </faces-config>

    And if you are specifying your own components, use the new Facelets Taglib schema as well:

    <facelet-taglib
    xmlns=”http://java.sun.com/xml/ns/javaee”
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd”
    version=”2.0″>

    </facelet-taglib>

  • 4. ICEfaces provides a number of configuration parameters that need not be adjusted for typical applications, but may be useful for diagnostic purposes or in special cases. Please refer to the official documentation for details.
  • 5. Redeploy your application with new ICEfaces configuration.

Official documentation: http://wiki.icesoft.org/display/ICE/ICEfaces+Documentation

If you need any assistance with configuring ICEfaces JSF Framework on any of our Java hosting plans – please email us at support@dailyrazor.com or click here to open a support ticket.