By bloid
via matthew-long.com
Published: Jan 04 2008 / 17:24
So, I’m going to take a quick detour from Cocoa development for a moment as at my day job I am working on a Java project. The application simply displays a list of items on the first page and then provides a link for each item to a details page. It’s pretty simple, however, it’s taken me two weeks to get it to the point where it actually displays the data. Now I’m working on formatting fields so that dates don’t just display as unix time stamps and fields that are labeled “Reachable” display as “Yes” or “No” rather than as “true” or “false”, etc.
Comments
bloid replied ago:
Pretty much sums up my experience of JSF as well...
dzonelurker replied ago:
The rule is simple: use what you clients demand: JSF, Struts, Spring, Hibernate, ... whatever. They set the rules.
henk replied ago:
It's doesn't sum up my experience with JSF at all. You have to know what you're doing and how things work, but isn't that true for every professional technology? Once you know your stuff, you'll find that JSF in an extremely flexible and powerful framework.
That said, in it's current offering it's much more a bare fundamental technology on which interesting things can be build, than a ready to use high-level framework. I.e. the standard supplied set of web components is extremely limited and the default templating engine (JSP) not the most optimal one (Facelets works much better). Things like Facelets don't really 'do right what JSF did wrong' though. As a fundamental core technology, JSF was explicitly build to make things like Facelets (or Seam for that matter) possible.
>Now I’m working on formatting fields so that dates don’t just display as unix time stamps
Seriously, there are things called converters for that. If the author didn't bother to learn about those, then that's his own mistake.
>I can’t debug anything with break points as everything is compiled into a java class at run time and all I ever see are tags, not Java code.
In JSF, tags (in this case jsp taglib tags) are specifically just -a- interface to a JSF component, which is pure Java. The taglib handler itself is a Java class too. Just look at the tld file associated with your tag (i.e. the one you reference at the start of your JSP page so you're able to use your tag in the first place). From there you can easily find the taghandler class and set a breakpoint inside it. Going from there you can put a breakpoint inside your JSF component or anything else it references.
I do wish though that Java IDEs would be a little bit smarter with this. Just ctrl-clicking on the taglib URI would be far more convenient than looking it up manually.
georgi replied ago:
JSF is not a simple "concept" to understand. What really baked my beans was the comparison of the author that he/she wants to do the things in PHP next time because *nothing* worked out - that showed that he did not try to adapt to the technology but just damned it anyway. Debugging JSF can be as easy as debugging any server software in Java (since JDK 1.4.x and, let's say, Eclipse). No explanation what went wrong means that the author did not understand what was going on for me.
p3t0r replied ago:
I feel that just reading a good book about JSF would solve most problems the author has... I do agree that JSF can be a bit awkward but please come with solid arguments next time!
Ignacio Coloma replied ago:
IMHO the problem with JSF is that every opinion fits one of these categories:
* You hate it.
* You have not tasted anything else (wicket, stripes, struts 2).
* You sell JSF books or JSF products.
Arguments like "If the author didn't bother to learn about those, then that's his own mistake" are not uncommon at all.
,
henk replied ago:
>Arguments like "If the author didn't bother to learn about those, then that's his own mistake" are not uncommon at all.
Probably because there's some truth into it ;) Not knowing anything about PHP, I could rush into writing a PHP page and then complain that it's a stupid language/platform since I am unable to open a file. Of course, if I had bothered to look into any kind of PHP manual for at least a minute it would have been clear to me how to do it. But if I neglect to do that, really, who's to blame?
I think there are at least two more categories into which JSF opinions fall:
* You love it, since it improved your productivity, is fun to develop for, whatever
* You tasted plenty of other stuff (PHP, plain JSP, Struts, Echo) and can therefor appreciate JSF, since it has those things 'they' hadn't
raveman replied ago:
or
You tasted plenty of other stuff (PHP, plain JSP, Struts, Echo) and can therefor hate JSF for being more painfull
raveman replied ago:
but its a good one, how someone even think about using API before they read a book about it? I will never use derby db from java6 before i read book about it, i think its just a datebase, but ....
if few pages of article is not enough doesnt that mean that its too complicated?
Voters For This Link (19)
Voters Against This Link (8)