views:

391

answers:

5
+2  Q: 

Struts 2 or JSF?

I am just starting with web application. Which framework should I try : struts 2 jsf? Both seem pretty good.

A: 

disclaimer: I do not know them, this is a general advice that will likely apply to this situation

You should read some of the documentation of both: if one is much more clear and understandable than the other, pick that one!

Otherwise try to use them both and see which one is good for you.

Lo'oris
Notice: as today (since a few days ago, actually) Struts2 docs are a little messed up (css problems)
leonbloy
A: 

If you want use ajax, you will prefer JSF with iceFace or Myfaces framework...

If not and if you want to get quickly your webapp, try Struts2 more simple...

chipeau
+15  A: 

Struts 2 is an Action Framework whereas JSF is a Component Framework.

An Action Framework is intimately tied to the HTTP request cycle and request format. A Component Framework tends to hide the underly HTTP request and use its own, higher level abstraction.

Action Frameworks tend to work better in stateless environments, Component Framework typically have a lot of session state associated with them.

If you're going to do a "web site", where URLs are important, lots of read only, higher loads of simpler traffic, etc. then an Action Framework may be more suitable.

If its a back office application, lots of CRUD screens, not as many users, complicated page and workflows, lots of page component interaction, then a Component Framework will be more suitable.

Both frameworks can do both jobs, just some are easier for the coder than the other for certain tasks.

Will Hartung
Nicely outlined. I myself would however have used the terms "request based MVC framework" and "component based MVC framework".
BalusC
Jonik
+1  A: 

there exists also good ajax solutions for struts2 so this is not a reason for JSF.

See: http://code.google.com/p/struts2-jquery/

jogep
A: 

JSF is a standard JEE 6 technology, Struts isn't.

Thorbjørn Ravn Andersen