jump to navigation

JSF Issues May 14, 2008

Posted by Phill in Frameworks.
Tags: , ,
trackback

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!)

Advertisements

Comments

1. Jonathan Locke - May 14, 2008

public class AlohaPage extends WebPage {
public AlohaPage() {
add(HeaderContributor.forJavaScript(…));
}
}

http://www.javalobby.org/java/forums/t77783.html

2. Phill - May 15, 2008

Yes, that looks pretty simple, also I think with Wicket you could actually put the <SCRIPT… tags in your HTML itself.

I’ve managed to find a solution to the problem without using redirects, which basically involves dynamic loading of JavaScript, but I’m still not sure I won’t get any more problems!

3. michelle - May 28, 2008

We use jsf, icefaces and spring webflow both in open source projects and our work places.

For starting javascript on load in a jsf environment just use a faceslets tag and call it from your page, alternately you can code a javascriptcontext call from your backing bean.

Or you can do what the icefaces autocomplete and calandar components do as well as what we do in 2 of our 3 custom icefaces components. ie. wrap your javascript IN AN ICEFACES CONTROL. and include it as myicefaces-extra.js from javascriptcontext.java Works great and solves all the dom update issues.

Jsf navigation is really bad, we adopted spring webflow at my workplace and coming formally from struts we find swf has all the capablilities and more, be careful with 2.0 , we had to use 1.5.

BTW: I’ve searched the web for projects or blogs on custom icefaces and although icefaces has been open source for a while very few people are even attempting this.

We have a specific target with our open source project the apple iphone. anyone interested in any tips please feel free to email us. shelly@mooncatventures.com.

4. JSF sucks « Incremental Operations - May 14, 2009

[…] JSF Issues – blog post by Phill. Quote: Although JSF does make some development quicker, the amount of […]


Sorry comments are closed for this entry

%d bloggers like this: