To configure your application to use the ICE Components, complete the following steps:
[icefaces.dir]/icefaces/lib/icefaces-compat.jar
3. Add the required dependent libraries to your application class path:
| Libraries | servlet-profile : Tomcat | web-profile : JBoss6, Glassfish 3 |
|---|---|---|
| commons-beanutils.jar |
Y | Y |
| commons-logging.jar |
Y | Y |
| javax.faces.jar |
Y | |
| jxl.jar |
Y | Y |
| krysalis-jCharts-1.0.0-alpha-1.jar |
Y | Y |
4. Add the required entries to the web.xml file:
<?xml version='1.0' encoding='UTF-8'?>
<!-- Have the proper schema version -->
<web-app version="2.5"
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-app_2_5.xsd">
<!-- 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>
</context-param>
<!-- 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>
<!-- If you're using ice:gmap component, you'll need your own key here -->
<context-param>
<param-name>com.icesoft.faces.gmapKey</param-name>
<param-value>ABQIAAAADlu0ZiSTam64EKaCQr9eTRTOTuQNzJNXRlYRLknj4cQ89tFfpxTEqxQnVWL4k55OPICgF5_SOZE06A
</param-value>
</context-param>
<!-- The JSF servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- Many of the ICEfaces Components make use of the Resource Servlet -->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- The standard mapping. Can use other extensions, or path mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- These specific mappings are necessary for the Resource Servlet to function properly -->
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/icefaces/*</url-pattern>
</servlet-mapping>
</web-app>
5. Add the ICE Components XML namespace to any pages you want to use components on:
<html ... xmlns:ice="http://www.icesoft.com/icefaces/component">
You are now ready to begin adding ice: component tags to your page.