views:

7108

answers:

11

I'm debating whether to use Seam, Wicket, JSF or GWT as the foundation for my presentation layer in a Java project.

I narrowed my selection of Java web frameworks down to this subset based on job market considerations, newness of the technology and recommendations from other S.O. users.

What factors should I take into consideration in deciding among these?

+5  A: 

The only one of those I've used is JSF, so I won't be able to give you feedback on the others, but here's my take on JSF. In my experience, the minute we converted from JSF in JSP to JSF in facelets, life got MUCH easier, so I'll focus around facelets. Also, It looks like Seam and JSF are not mutually exclusive.

Pros:

  • Creating facelets xhtml components is simple, which promotes re-use.
  • Decent templating abilities using built in tags like ui:insert, ui:include, and ui:decorate
  • Simple access to Spring beans through faces-config
  • XHTML based so web developers unfamiliar with java can still be effective
  • Good widget library available in tomahawk/trinidad

Cons:

  • Post requests only. This can make bookmarking difficult.
  • Not as built-in ajax-y as GWT, but this may be fixed if used with Seam

I'm by no means an expert in JSF/Facelets, so I'm sure there are others I've missed. Hopefully someone else will also elaborate.

Update for JSF 2.0:

digitaljoel
tomahawk/trinidad - good tip. Thanks.
karl
Seam makes it easy to use GET requests and have bookmarkable URLs with JSF.
Peter Hilton
Thanks Peter, I'll have to look into it.
digitaljoel
If you search for 'wicket' in stackoverflow, you will find many discussions on these web frameworks which may help you. Particularly http://stackoverflow.com/questions/24596/what-web-application-framework-for-java-is-recommended and http://stackoverflow.com/questions/538550/pros-and-cons-of-various-java-web-presentation-layer-technologies
digitaljoel
Adding on to this question of frameworks, which would be preferred if seo is important?
Nick
I don't know much about seo (I'm assuming you mean search engine optomization), but I'm guessing ajax/javascript can interfere with it. It's all about how you disseminate the content though, so I suspect you could successfully use any of these depending on how you structure you app and presentation. In my limited experience, I would think a full blown GWT app might be the most difficult for SEO.
digitaljoel
+6  A: 

Seam is an application framework, not really a presentation layer. It was originally developed to make JSF less painful, but has evolved into a more general purpose dependency injection framework.

I believe that you can use Seam with JSF, Wicket and GWT. JSF support is primary and excellent; I'm not sure how well the other two are supported.

Since the focus of your criteria seem to be the marketability of your skills, I would suggest trying out Seam and JSF via Facelets. JSF is a well accepted standard and is actually enjoyable to use if you are using Facelets. You can have slick AJAX functionality via Richfaces and Ajax4jsf. Seam is being more or less standardized via the JCP.

recampbell
Interesting. Does Richfaces tie you into JBoss? You also recommend the Facelets route - I don't see any job postings that mention it - is this because it's relatively new or because job postings are more likely to just mention JSF?
karl
JSF was first used in JSP, and then in facelets, but I believe the JSF group favors facelets. This is evident in the JSF 2.0 spec which has a table showing the advantages of facelets over JSP.
digitaljoel
Karl - Richfaces should be usable in any container that supports JSF, there are no JBoss dependencies that I am aware of. As for job postings, I would personally avoid any job that requires JSP; facelets are the way to go. ;-)
recampbell
Forget JSP. Facelets is the default view technology in Seam (and JSF 2.0) so Seam usually implies Facelets, although there is some Wicket support.
Peter Hilton
I've not been enjoying using richfaces. If I could take XCSS without any of the built in "basic" XCSS used in the control suite then its would be great, otherwise its origins in an educational establishment are clear as day. It gets in the way and prevents you from freely utilising your existing expertise in HTML and CSS. Otherwise +1 for a good answer. Seam Remoting "just works" and is recommended for AJAX.
Simon Gibbs
A: 

In a long term scenario I'd recommend using technologies backed by a Sun specification. This has so far proven to give multiple implementations resulting in choice (frequently also open source implementations), plus behaviour tends to be very well defined.

That will help you in a maintainance scenario, which - hopefully - your code will end up too in time. Well-written code lives forever :)

In this particular scenario I would suggest JSF. I have only tried the Apache implementation of 1.1, but it hurt to be on top of JSP. We are to revise it soon - I expect to look into having JSF on facelets.

Thorbjørn Ravn Andersen
I would argue that choosing a Sun specification is not that important as many defacto standards (Struts, Hibernate, Spring, Log4j, etc.) were Sun specs and yet were widely adopted due to their power and utility. If anything, these successful projects later drove the creation of standards once proven which is decidedly not the case with JSF.
Brian Laframboise
Edit: ...were *NOT* Sun specs...
Brian Laframboise
I was talking long-term. Which of the frameworks you mention do you expect to be supported in 10 or 20 years time? Code tend to live forever.
Thorbjørn Ravn Andersen
A downvote? For saying that long term maintenance is important? And JSF made it in JEE 6... Oh well.
Thorbjørn Ravn Andersen
A: 

I've used Wicket and GWT pretty heavily. Never really learned to love Wicket.

My ego blogged about it http://salk31.blogspot.com/2009/07/wicket-ajax.html

Looking at GWT 2.0 uiBinder today reminded me how annoying it was in Wicket to have to match the XML component tree with the one created in Java. The GWT spin on this looks vastly better to me.

I've not used Wicket for over a year so maybe they have fixed a lot of this but given modern browser and JS support I can't see the point of doing all this on the server (I know, I know data locality).

salk31
A: 

Both Wicket and JSF are obsolete by HybridJava v0.98: http://www.hybridserverpages.com/

Dima
A: 

JSF is deprecated (JSF is not even listed as a framework to compare when evangelists compare or talk about web frameworks in 2010).

Now full fledge large scale applications are created using GWT, YUI, JQuery etc.

Read some articles over google and above will be obvious.

(ALL JOBS on JSF are to support legacy applications).

daud
+1  A: 

If you consider only job market , you should choose JSF. But, I belive that the future of RIA belongs to GWT and gwt like client side technologies.

I think that the most obvious upside of GWT, it is better scaleable than server side presentation layer technologies such as JSF, wicket. Because , server does not need to store client state and the client cpu power also are also used.. It is a huge benefit, you dont need to serialize client state between server computers to achive fault tolerant system.

Gursel Koca
+1  A: 

I vote for JSF I created this blog about my experience with GWT(about 1 year on that I spend at work). Occasionally , I also wrote JSF application(about 1 year on that I spent at home)

My mistake was I chose simple MYFACES (simple and old JSF implementation).

But even that one is better, than GWT , because it's easier to write. Easier to understand and 10 other reasons(see blog link below)

The best solution if you need just presentation layer is GOOD JSF implementation, like Trinidad, like RichFaces.

But if you need complete 3 layers solution(presentation, business, data) - take JbossSeam.

I have no relation to Jboss, I just read, tried and know!!!!

Google's products are highly OVERESTIMATED. You CAN build good application on GWT, but it will have 10 disadvantages(see blog).

I write GWT RIGHT NOW, making breaks to tell the truth here...

It's not good. Trust me. Or not trust me, just go in that way. It's your problem, buddyyy.

http://javafuck.wordpress.com/2010/07/28/gwt-is-abbreviation-for-greedy-and-wasteful-technology/

Peter
Trinidad and RichFaces are NOT implementations of JSF, they are both component libraries for JSF. There are only two JSF implementations: Mojarra (Sun RI) and MyFaces core.I think your point is that you should not just use a bare core JSF implementation, but that you should take advantage of the many powerful component libraries (RichFaces, OpenFaces, PrimeFaces, etc) and extensions (like Seam).
arjan
oh, yes. Thanks!
Peter
+2  A: 

Thanks wicket guys for remaining sober and keeping over this discussion. I am a wicket user and i love it. My main reasons are :

  1. Its a component framework. I love working with components as opposed to full pages.
  2. I can let the designers work on the templates and pages as i work on the java parts

  3. There is nothing new to learn. Its "just java and just HTML"

  4. I like its ajax Fallback mechanism. Where there is not javascript support on a browser especially on mobile devices, it falls back to plain html and everything works.
  5. Its lack of xml configuration is a plus
  6. It supports everything i would want in a web application. e.g validation, internationalization, back button support and restful URLs among others

My previous experience is GWT and JSF 1.0

regards. Josh

joshua
A: 

My last comparison JSF-GWT-FLEX

Peter
+2  A: 

I've used GWT since version 1.4 and JSF since the 2.0 spec came out.

GWT is a client-side framework, it generates JavaScript from Java. Your architecture would be a pure client-server, which means:

  • Best to use coarse-grained services
  • All objects that travel to the client side should be fully serializable (it means there's no lazy load, or OpenSessionInView pattern)
  • Since GWT 2.0 you can design your gui using xhtml, which is much easier in regards to styling & structuring HTML
  • GWT tends to favour good architecture, if you mess it up it will be bad to refactor
  • Perfect History (browser back button, bookmarkable urls) support is hard, you probably have to roll your own, although it's easy to hack something right up front

JSF is a component-based framework, with a view-first design (code-behind if you like):

  • It's easier to do some type of webapps (stateful, like shopping cart)
  • JSF+Seam have suport for conversations (think wizard-like pages that maintain state across several pages)
  • You can implement OpenSessionInView, depending on your stack. It's probably not recommended if you use EJB for service/business layer
  • JSF2 has superb support for AJAX, and with a component suite like RichFaces you can build nice webapps
    • But if you want exquisite javascript behaviour, you'll have to write some javascript
  • JSF tracks the current UI state in client or server-side. This is a tradeoff between network traffic or server memory.

Resume:

  • GWT is more adequate for web applications (think gmail) that require the best client-side performance. It's easy to write custom components (you write Java) and since your server-side is just a service layer you can be fully stateless on the server side.
  • JSF is more adequate for mostly CRUD applications that are better suited for component-oriented stuff: think a hotel/flight reservation system, an online store with a shopping cart, etc
Miguel Ping