This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Application Frameworks and the fly likes When it comes to frameworks for web applications, which is better-Struts or JSF? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "When it comes to frameworks for web applications, which is better-Struts or JSF?" Watch "When it comes to frameworks for web applications, which is better-Struts or JSF?" New topic
Author

When it comes to frameworks for web applications, which is better-Struts or JSF?

charlsy chuks
Ranch Hand

Joined: May 18, 2012
Posts: 75
Please I would like to know which you would recommend among these two for any category of web applications.
Would it be preferable to use Struts or JSF?

Thank you for the usual quick replies.

Charles.
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3285
    
    7
Eventually, you will need to learn both. But I would suggest you to start with Struts not because it is better or worse but because it is still heavily used in the industry.
HTH,
Paul.


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41592
    
  55
This question can not be answered in general, so I very much disagree with Paul's answer. The answer may very well be "neither".

Note that the widely used version of Struts is Stuts 1, which has been dead (as a project) and thus obsolete (for new projects) for quite some time. Struts 2 is not nearly as widely used; I recommend to learn it only if you already know that you will need it.

As regards JSF, it has proponents and detractors. Most of its proponents seem to like it because it's part of JEE (not a good reason in my book, as other frameworks can easily be used with JEE), and not necessarily for its technical merits. Its detractors seem to have strong opinions about not liking it.


Ping & DNS - my free Android networking tools app
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3285
    
    7
Ulf Dittmer wrote:This question can not be answered in general....

I have seen similar answer many times on this forum and I always find it annoying. You can always answer based on the information posted by the OP. Of course, the more information OP posts the more "correct" the answer can be. Why, you might even ask for the age of the poster to make your answer even more "correct". But that doesn't make any sense. I would rather OP ask further questions than the responder ask for more information.

OP's question is simple and I find such winding answers practically useless.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

I agree with Ulf.

No one will need to learn either; let alone both. While I've familiarized myself with both so that I can make informed decisions, I've never used either in a project. In fact, more than a handful of my jobs have been to take monstrosities developed in either (especially JSF) and refactor them into more manageable projects.

So while I would say that it's never a bad idea to learn something new, no one needs to learn either.

As to which is "better": that's unanswerable and subjective. My own opinion is obviously neither. If I have to recommend a framework, I'd recommend either of Play! or SpringMVC before Struts 1 or 2. And I'm on the record as thinking that JSF is a cancer that needs to be surgically excised from the face of the Earth.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

Paul Anilprem wrote:You can always answer based on the information posted by the OP.

I do not see how Ulf's response fails to address the question that was asked; albeit with a differing opinion than yours.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Paul Anilprem wrote:OP's question is simple...


Yes, it is. But simple questions don't necessarily have simple answers, or even any answers at all.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5216
    
  12

In the past (6-7 years ago) I developed web applications with both Struts (version 1) and JSF. But today I would recommend neither for web application development. Without any doubt my recommendation is Spring MVC when you are looking for a framework to develop web applications. Since 2012 I develop mainly web applications and all of them were developed using Spring, Spring MVC and Hibernate.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 229
Charles, depends on what you are seeking to build. There was a good answer provided here: http://stackoverflow.com/questions/2845271/struts-2-or-jsf which details the difference between Action Framework and Component Framework. Is your question purely from learning point of view?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When it comes to frameworks for web applications, which is better-Struts or JSF?