jump to navigation

JSF Issues May 14, 2008

Posted by Phill in Frameworks.
Tags: , ,
comments closed

The project I’m currently working on is using JSF and IceFaces. It’s been a while since I used JSF, and I’d forgotten just how annoying it can be at times. The problem is always using frameworks that write the HTML for you: if you don’t have so much control over what is actually output to the browser, if you have a problem (which you inevitably will) fixing it will not be a simple matter.

Take today, for example. I wanted to include a custom JavaScript on an IceFaces page. Simple enough, you would think. Unfortunately, I had a problem where it would only work once you’d refreshed the page! Bizarrely, Firebug showed the JavaScript as existing in the JavaScript body – but it didn’t seem to actually be loaded by the browser.

I think this might be a problem with the way IceFaces loads things up using AJAX, but either way i’m none too impressed. The solution for the time being is to actually use a <redirect/> tag in my faces-config.xml (as suggested on this thread), this isn’t an ideal solution but it seems to work for the moment.

Although JSF does make some development quicker, the amount of time you lose to stupid problems like this probably negates any gains you made originally.

For the next web based project I do, I think I will try something like Spring WebFlow or Wicket, which both look like very interesting frameworks and don’t suffer from the same issues as JSF (although undoubtedly they have their own issues!)