Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF 1.2 application migration to JSF 2.0

Tags:

jsf

Currently, my web-application is based on the following libraries / frameworks / tools:

  • Java 1.6
  • JSF 1.2_07-b03-FCS
  • Facelets 1.1.14
  • Richfaces 3.3.2.GA
  • EL-Functors 1.0.2
  • Spring 2.5.2
  • Tomcat server v5.5

Some additional information:

  • Spring is in charge of managing all the beans used by JSF (org.springframework.web.jsf.DelegatingVariableResolver is defined as the variable-resolver in my faces-config.xml file).
  • EL-Functors is used as my el-resolver in order to extend the Expression Language.
  • I've created many custom components, some of them are just Facelets compositions, others are Java-based components (some of them are extending Richfaces components).

I want to try (essentially for curiosity, but if this works well, why not for real?) to migrate my application to JSF 2.0.

Question #1: what are the critical points that I must consider in order to make my application working correctly?

I am talking here about just having a working application, nothing less, nothing more.

I alread know that I will have to review all my custom components, because I will use the new version of Richfaces (4.0), and also see if they work correctly.

Question #2: what will be the first steps to achieve to take advantages of JSF 2.0? Some ideas I already have are:

  • Remove EL-Functors and use the Expression Language 2.2;
  • Let JSF manage the beans, and use the @ManagedBean. Or maybe switch to a CDI library, such as Weld?
  • Use <f:ajax> instead of <a4j:support>?

Regarding JavaEE6

I know, a good idea would be to completely move to JavaEE6. I'd liked to do so, but for some reasons I just can't do that way. One (bad) reason is that I must stay on Tomcat servers. However, I can add new third-party libraries in order to have some JavaEE6 features, such as EL 2.2... So please consider this aspect in your answers.

Regards.

like image 544
Romain Linsolas Avatar asked Nov 06 '22 06:11

Romain Linsolas


1 Answers

Since Richfaces 4 is still under development you may want to use Richfaces 3.3.3 with JSF 2.0. Thus you have to use Facelets 1.1.15 as described here http://community.jboss.org/wiki/RichFaces333andJSF20

This implies that switching from a4j:support to f:ajax won't work with your Richfaces based components so I suggest to stick to a a4j:support. This will also keep the migration effort low if you decide to switch to Richfaces 4 as soon as it is available.

Since you already use Spring to manage your JSF-Beans there should be no need to use the DI-Features of JSF2. I'd stick to Spring but consider an update to Spring 3.

Besides this, Weld is definitley worth to take a look at.

HTH

like image 93
tasel Avatar answered Nov 15 '22 11:11

tasel