After this article you will can create and work with ICEfaces inside Intellij IDE. I will walk with you step by step with pictures to be clear for all.
1- you should create new project from file menu, you will see the below window.
2- then you will see the other dialog to fill project information, we just will fill project name and keep other fields with default value. see the below picture for more illustration
3- the other dialog to specified the source folder, keep it as default. After specifying the source code folder you will move to most important window, in this window you will specify which framework and which web server you gonna use.
here we will select JSF framework and application server.
when you select JSF they ask you to download JSF RI or create custom library for JSF RI. I prefer to download which JSF RI you wanna used and create custom library for it, select user library then press on create button and specified JSF RI. usually Mojarra shipped with ICEfaces library.
the project will be like the below picture.
4- you should create lib folder under web –> WEB-INF
5- you need to add some context parameters and listenerĀ in web.xml
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!– this context parameter for configure jboss el –>
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>
6- we will make our senario with index page, by default index.jsp generate it when you create the project. change the extention of the index file to xhtml. through right click then refactor then rename.
7- remove the directive, and add this html header.
<html xmlns=”http://www.w3.org/1999/xhtml“
xmlns:ui=”http://java.sun.com/jsf/facelets“
xmlns:f=”http://java.sun.com/jsf/core“
xmlns:h=”http://java.sun.com/jsf/html“
xmlns:icecore=”http://www.icefaces.org/icefaces/core” xmlns:ice=”http://www.icesoft.com/icefaces/component“
>
if you wanna use advanced library add this
xmlns:ace=”http://www.icefaces.org/icefaces/components“
finally change the html header and body to JSF component,
<h:header></h:header>
<h:body></h:body>
8- now we gonna add the necessary library for ICEfaces, i will list the library needed for ICEfaces.
ICEfaces Core Component with needed jars with jboss el:
- icefaces.jar
- icepush.jar
- commons-beanutils.jar
- commons-collections.jar
- commons-digester.jar
- commons-logging.jar
- krysalis-jCarts-1.0.0-alpha-1.jar
- jxl.jar
- icefaces-compat.jar
- jboss-el-2.0.0.GA.jar
if you wanna use ICEfaces advanced component add this jar:
- icefaces-ace.jar
now i will show you how to add this jars, right click on module then press on open Module Setting. you will see the below picture.
from the left panel, you will see library option. press on plus button.
you will see confirmation dialog press Ok. then change the name of library, and add jars mention above from attach classes button on the right side.
8- Now we gonna add jars to default artifact, from the same window go to Artifacts from the left panel. you will see the default artifact.
Under WEB-INF you will find two folder, classes and lib. go to lib folder and add the library you added in step 7 to through plus button and choose library files. Check the below picture
That set! You can now run your JSF application. I used tomcat 7 here
hope this helpful.







