Setting up an Icefaces facelet project from scratch.

Icefaces is a rich extension to Java Server Faces. One of the problems in getting an icefaces application up and running is the inital setup. In this tutorial I’ll walk through how to build a basic Icefaces application (Using facelets).

I love IDEs like intellij and Eclipse. They make setting up projects easy. But I have found that setting up my projects from scratch gives me the flexibility I need, and also makes integrating with an automated build system easier.

Project layout

/simple-ice-facelet/ Project Root
/simple-ice-facelet/lib/ Required Jar files to run the web app
/simple-ice-facelet/src Java source
/simple-ice-faceletd/web Web Contents

Required Jars found in icefaces/lib

  • backport-util-concurrent.jar
  • commons-beanutils.jar
  • commons-collections.jar
  • commons-digester.jar
  • commons-fileupload.jar
  • commons-logging.jar
  • commons-logging-api.jar
  • el-api.jar
  • icefaces.jar
  • icefaces-comps.jar
  • icefaces-facelets.jar
  • xercesImpl.jar
  • xml-apis.jar

Bare bones app config


<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="">



<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">


<display-name>Simple ICEFaces App</display-name>

Just getting started








<load-on-startup> 1 </load-on-startup>

<load-on-startup> 1 </load-on-startup>

<load-on-startup> 1 </load-on-startup>





And now for a basic facelet page.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""

<ice:panelGroup draggable=”true” style=”width:200px;border:1px solid black;”>
<ice:outputText value=”If you can drag me then it works!”/>

And Finally the build file. You will need to have TOMCAT_HOME defined.


<project name="simple-ice-facelet" default="war" basedir=".">
Simple Icefaces Facelet app

<property name=”src” location=”src”/>
<property name=”build” location=”web/WEB-INF/classes”/>
<property name=”icefaces-lib” location=”lib/”/>
<path id=”base.path”>
<pathelement path=”${classpath}”/>
<fileset dir=”${icefaces-lib}”>
<include name=”**/*.jar”/>

<property environment=”env”/>

<target name=”compile”
description=”compile the source ” >
<mkdir dir=”${build}”/>
<javac srcdir=”${src}” destdir=”${build}”>
<classpath refid=”base.path”/>
<copy todir=”${build}”>
<fileset dir=”${src}”>
<include name=”**/*.xml”/>
<include name=”**/*.tld”/>
<include name=”**/*.js”/>

<target name=”war” depends=”compile”
description=”generate the distribution” >
<war destfile=”facelet.war” webxml=”web/WEB-INF/web.xml”>
<fileset dir=”web”/>
<lib dir=”lib”>

<target name=”clean”
description=”clean up” >
<delete dir=”${build}”/>

<target name=”copy.war” depends=”clean, war”>
<copy file=”facelet.war” todir=”${env.TOMCAT_HOME}/webapps”/>

Run the copy war then open http://localhost:8080/facelet/test.iface If you can drag the div around the screen then this tutorial has been a success!

Need help developing your ICEFaces application? I can provide ICEFaces consulting. Contact me at for more information.

This entry was posted in Icefaces. Bookmark the permalink.

6 Responses to Setting up an Icefaces facelet project from scratch.

  1. ataras says:

    i have this exception
    javax.faces.FacesException: Problem in renderResponse: null

  2. Cem says:

    A Maven archetype could be great 🙂 Anyway, thanks.

  3. Many thanks, this tuto was exactly what I needed.

  4. Ela says:

    Thank you so much! Just what I needed..

  5. ali says:


    I arranged to create java web project with icefaces 1.8.2 and myfaces 1.2 but I couldn’t run my application.

    sometimes I got this error:
    “java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet”

    and sometimes I got this:
    “java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings”

    I think my jar files and also configuration files (web.xml, faces-config.xml) are wrong.
    please if you have some sample code with icefaces, attach to me.

    Thank you to pay attention to this matter.
    I’m looking forward to hear from you.


  6. gadi says:


    I have an existing facelets project with NetBeans 6.7. I followed your steps to integrate ICEFaces and it works!

    many thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *