Saturday, May 28, 2011

ICEFaces redux

Ok, I've just started to take a look back at JSF (ICEFaces 1.8, to be precise): this means also using JSF 1.1/1.2 instead of the more recent JSF 2.0 (which is supported in ICEFaces 2.0). Why? Just corporate legacy mindset ;)

I used ICEFaces 1.7 with JBoss SEAM 2.1 and I still feel the pain: why not using RichFaces instead of ICEFaces? Corporate decision-making is out of my sight :| Ok, since now it is a must for me to understand it right, I've decided to take an easy-going approach: just beginning with the site tutorials and then take small steps with my own modifications.

Ok, let's get started. Downloaded ICEFaces 1.8.2 from the site and deployed my tutorial WAR (timezone #1) into my local tomcat 6.0.32. Bam!


"ICEFaces is back" has been my first thought but kept on trying with the other tutorials which, fortunately, did work so I could continue.

The first thing I noticed with just clean JSF 1.2 is the lack of any dependency injection and/or interceptor feature: just a plain faces-contex.xml file where to put your page beans.

Having appreciated the benefits of the Spring Framework, I just switched my focus to make Spring publish the application context's beans as JSF managed beans. The documentation provided the tips, so ... did I just put the spring jars within the tutorial example and run it? Of course not! Since I've also appreciated maven, I also mavenized the project: this has proved to be really easy (just searching the dependencies over google in order to add them to my pom.xml file).

To cut it short, I've modified the web.xml in order to introduce Spring specifics configurations inside it (just like any other Spring web application out there):



Then I modified the faces-config.xml according to the Spring documentation in order to introduces Spring JSF Expression Language (EL) resolver:



Noted the lack of any managed bean definition, eh?

Finally I created a simple application-context.xml file which defines the bean used in the example (which, being created by Spring bean factory, means that it will benefit of dependency injection and AOP like security, transactions and so on):



Ok, next step is to make it cooler by using annotations and see how Spring controllers can fit within it. Ah, and also taking a look at how AJAX works with JSF/ICEFaces/Spring.

Monday, January 24, 2011

Una nuova (alta) definizione



Niente politica, in questo primo post del 2011: giusto un'occasione per condividere il risultato finale di una serie di peripezie.

Tutto ha origine nella mia necessità di cambiare la scheda video corrente, una Radeon HD 4850 (tutto falso: è solo per fare lo sborone con le braccine corte) con una nuova. Dopo qualche settimana di analisi (fuffamento su internet) alla ricerca della migliore soluzione tra NVidia e AMD per il mio portafogli, ho optato per la Radeon HD 6950: ordinata a fine dicembre è arrivata il 5 gennaio.

Quindi prima notizia: oggi sono finalmente riuscito a montarla nel case del mio PC. E nel frattempo? Nell'ordine:
  1. mancanza del cavo a 6-pin per PCI-Express (la 6950 vuole ben due cavi a 6 pin contro uno solo del vecchio modello). Ovviamente dove mi trovo non ho sottomano il cavo e sembra un'impresa trovarlo qui a Bari: ho dovuto aspettare di tornare a Brindisi per procurarmelo (parte della dotazione del mio alimentatore modulare Zalmag).
  2. Avuto finalmente il cavo, nel momento di montarlo ho scoperto che per pochi millimetri la scheda video non entrava nel case (urtava sul telaio interno in metallo per il montaggio degli hard disk). Il gigante infatti, oltre a pesare 1,5 Kg è pure lungo quasi 39 cm: quindi attenti!
  3. Oggi finalmente mi sono procurato il seghetto per metalli e ... giù di nobile lavoro manuale. In una quarantina di minuti ho praticato un taglio sufficiente a piegare la staffa di quei 5-10 gradi sufficienti a inserire il molosso elettronico.
Quindi, in conclusione, a quasi un mese dall'ordine sono riuscito a montare il tutto e questo è il primo post scritto per l'occasione. Provato Mass Effect 2 alla massima risoluzione e pare andare. Ora scusate ma ho da completare una serie di test approfonditi :D

Update: giusto per la cronaca ecco come si è ridotto il seghetto alla fine.