TOC PREV NEXT INDEX

Registering ICEfaces Servlets


As an extension to JSF, ICEfaces provides its own version of the FacesServlet (PersistentFacesServlet) as well as an additional Servlet (BlockingServlet) for handling asynchronous updates. We register these Servlets in the deployment descriptor file (web.xml) by adding the following entries:

<servlet>
 
		<servlet-name>Persistent Faces Servlet</servlet-name>
 
		<servlet-class>
 
				com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet
 
		</servlet-class>
 
		<load-on-startup> 1 </load-on-startup>
 
</servlet>
 

 
<servlet>
 
		<servlet-name>Blocking Servlet</servlet-name>
 
		<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
 
		<load-on-startup> 1 </load-on-startup>
 
</servlet>
 

We also need to add a new Servlet mapping of PersistentFacesServlet to .iface.

<servlet-mapping>
 
		<servlet-name>Persistent Faces Servlet</servlet-name>
 
		<url-pattern>*.iface</url-pattern>
 
</servlet-mapping>
 

We also need to add a couple of mappings for ICEfaces' internal use.

<servlet-mapping>
 
		<servlet-name>Persistent Faces Servlet</servlet-name>
 
		<url-pattern>/xmlhttp/*</url-pattern>
 
</servlet-mapping>
 

 
<servlet-mapping>
 
		<servlet-name>Blocking Servlet</servlet-name>
 
		<url-pattern>/block/*</url-pattern>
 
</servlet-mapping>  
 

When using ICEfaces with JSP pages, we need to change the DEFAULT_SUFFIX entry to specify ".jspx" pages instead of the JSF default ".jsp" pages. This tells JSF to use .jspx as the default suffix so that requests are properly directed to ICEfaces' PersistentFacesServlet.

<context-param>
 
	<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
 
	<param-value>.jspx</param-value>
 
</context-param>
 

By default, ICEfaces uses asynchronous update mode that fully supports server-initiated updates (Ajax Push). For this tutorial step, we will not be leveraging asynchronous update mode, so we can optionally configure ICEfaces to use synchronous update mode instead:

<context-param>
 
     <param-name>com.icesoft.faces.synchronousUpdate</param-name>
 
      <param-value>true</param-value>
 
</context-param>
 

When using some versions of Tomcat, users have reported seeing the following error occasionally "SEVERE: ICEfaces could not initialize JavaServer Faces. Please check that the JSF .jar files are installed correctly." If you experience this error, specifying the ConfigureListener will resolve this issue with Tomcat, even though it is not generally required for ICEfaces:

<listener> 
 
 		<listener-class>com.sun.faces.config.ConfigureListener</listener-class> 
 
</listener>
 


Copyright 2005-2009. ICEsoft Technologies, Inc.
TOC PREV NEXT INDEX