Wednesday, January 19, 2011

Encounter with Java Server Faces 2.0 + facelets + primefaces 2.2

Hello All,

I would like to share the experiences of my encounter with JSF2.0 + facelets + primefaces, so it goes...


My previous project was on Struts 1.x and was an Identity and Access management application and my prime motive is to replace the framework with some more Robust, Flexible, Secure and Latest framework, for sure it was a very tiring quest to choose best among best as today there are lot many good frameworks available in the market but I was quite amazed with the advantages of JSF 2.0 which actually addresses my requirement in a very peachy fashion, few are listed below as:

1. Its a standard i.e. JSR  219.
2. Open Source.
3. Wide Industry support.
4. Rich UI.
5. Support multiple client devices.
6. Its a component oriented and event driven framework for web application.
7. Application development is easy, fast and also easy to maintain.
8. Inbuilt AJAX support.
9. Internationalization and Localization support.
10.pluggable render technology.
11. Support for Facelets.


It has everything that I was craving for, Finally I started with the development for the prototype , I have browsed a lot but most of the time was left baffled because of version conflicts as JSF2.0 has lots of advance changes from the previous versions and it really proved the motive of its existence, am jodding down  few tips to be taken care while development.
1. For JSF 2.0 default view technology is Facelets and for using it include jsf-facelet.jar which is for sure a far better solution than jsp's for jsf.
2. If you need jsp as view technology then you should make an entry in Faces-config.xml for FaceletViewHandler but no need for facelet.
 3. For using Ajax for sure you have to use <h:head>, When you use <f:ajax> the system automatically inserts a <script> tag into the <head> section of the page. It cannot find the head section unless you use <h:head>.
4.You can break configuration files into as many files you like but just make the entry in web.xml
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value> WEB-INF/common/manage-beans.xml,
WEB-INF/common/navigation-rule.xml, WEB-INF/common/config.xml
</param-value>
</context-param>
5. For using Primefaces just include the primefaces.jar, import the namespace and just use the tags no other configuration is required and also it has lot many mesmerizing widgets.

 I used NetBeans 6.9.1 + tomcat 6.0.24 + jsf 2.0 + facelets + primefaces 2.2

hope to be useful

Saurabh...



Wednesday, July 28, 2010

@jaydeep ->

mail your doubt to "ravi.shankar@magnaquest.com" definitely i'll help you out.

java world

Hi people,

Fire your doubts in java, sooner or later i'll try to clear it.