ICEfaces Sample Applications

Table of Contents

ICEfaces Sample Applications

The ICEfaces distribution comes with example applications that illustrate the key features of ICEfaces as well as providing source code and guidance about configuration and library dependencies.

ICEfaces 3.0.x: If you've built the entire source tree using Ant or you've built any of the samples using Ant and you want to start using Maven instead, you should do an 'ant clean' in the sample directory before attempting to use Maven to build them. The reason is that the Ant builds can leave files or artifacts that can interfere with the Maven builds and lead to errors or incorrectly built .war files.

Example Organization

The examples that come bundled with ICEfaces can all be found under [icefaces.install.dir]/icefaces/samples. Under that directory the examples are organized as follows:

/compat: The compat examples illustrate the use of the original ICE Components suite running on the latest ICEfaces framework. The main example is AuctionMonitor - an online auction simulator implemented using the compatible ICE Components, the ICEfaces core framework, and Ajax Push. This sample demonstrates how older ICEfaces applications can be easily migrated to the latest versions of ICEfaces.

/core: The core examples use only standard JSF 2 components enhanced with the core ICEfaces framework. As such, they require fewer library dependencies. The main example is Auction - an online auction simulator implemented using JSF standard components, the ICEfaces core framework, and Ajax Push. This sample demonstrates how ICEfaces can provide automated-ajax and push update capabilities to standard JSF applications with minimal changes.

/showcase: The main application under the showcase directory demonstrate key ICEfaces features, including extensive demos for both the ACE Components and the ICE Components.

Building with Maven

Each example has a pre-configured .pom file that can be used to create the requisite .war file for the application. To do so:

  1. Open a shell or console window.
  2. Navigate to directory of the sample you are interested (e.g. [icefaces.install.dir]/icefaces/samples/showcase/showcase).
  3. Type the following Maven command to create the .war file:
> mvn package

Profiles

The sample .pom files offer a choice of profiles that allow you to build the .war file the way you like. The profiles include the ability to include (servlet) or exclude (web) the JSF libraries from the .war file as well as choose which JSF implementation (Mojarra or MyFaces) to use. The profiles are:

  • servlet: Mojarra version of JSF libraries included in the .war
  • servlet-myfaces: MyFaces version of JSF libraries included in the .war
  • web: JSF libraries provided by the container and excluded from the .war
Profile Description
servlet Mojarra version of JSF libraries included in the .war
servlet-myfaces MyFaces version of JSF libraries included in the .war
web JSF libraries excluded from the .war and provided by the container

By default, the examples are built using the servlet profile which means each .war file includes the relevant version of the Mojarra JSF libraries. To build using a profile other than the default:

  1. Open a shell or console window.
  2. Navigate to directory of the sample you are interested (e.g. [icefaces.install.dir]/icefaces/samples/showcase/showcase).
  3. Type the following Maven command to create the .war file:
> mvn clean package -Pservlet-myfaces

or

> mvn clean package -Pweb

The resulting .war file and other generated files can be found in the /target directory of the example.

Portlet Samples

You can find more information on Portlets and the examples under Portlet Development. For specific instructions on how to use Maven to build the portlet examples and include the appropriate portlet bridge, see the section titled Sample Portlet Applications.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2021 ICEsoft Technologies Canada Corp.