This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 vs JSF or Velocity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 vs JSF or Velocity" Watch "Struts 2 vs JSF or Velocity" New topic
Author

Struts 2 vs JSF or Velocity

Iván Párraga
Ranch Hand

Joined: Dec 02, 2007
Posts: 54
Hi all,

Struts can be considered a model 2 framework: ther are controllers which add logic (data processing, flow control...) and dispatch to the view compoments.

There are many other frameworks with this approach but unfortunately I have no real experience with all of them, so I would be interested to know what are the advantages (and drawbacks) of Struts 2 vs. other popular frameworks like JSF, Velocity, Tapestry, Wicket...

Cheers!

Iv�n


Iván Párraga García
SCWCD 5, SCJD, SCJP 5, MySQL 5 DBA
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
I don't think it is a fair comparison between Struts 2 and the list you had. A fairer comparison would perhaps be between Struts 2 and SpringMVC. As you have stated, there're bound to be pros and cons in each technology out there, so it's really just a matter of using the right tool for the right job.



SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
I would also like to add that velocity's power is in templating, and not as being a web framework


Visit my blog: http://jnassef.blogspot.com/
Iván Párraga
Ranch Hand

Joined: Dec 02, 2007
Posts: 54
Hi.

I agree with your answers. My question could be asked again like this: "what is the right tool for the different kind of projects?" and "which tool could be compared in a fair fashion with Struts (and then pros and cons)?"

For example, in what Spring MVC + Tapestry beats Struts 2 (and vice versa)?

Cheers!

Iv�n
Sougata Som
Greenhorn

Joined: Apr 29, 2008
Posts: 12
Yes, a comparative analysis between the different frameworks would be really helpful. Moreover, can someone please explain in what ways Struts 2 is any better than Struts 1 and, for that matter, how does it compare with a well-designed web application written using only JSPs, Servlets, JSTL, EL and Design Patterns ?


Cheers,<br />Sougata Som
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Yes, a comparative analysis between the different frameworks would be really helpful. Moreover, can someone please explain in what ways Struts 2 is any better than Struts 1 and...

Take a look at this link. At the bottom of the page, there're links to PDFs that compares between various web framework (by Matt Raible, 2005). As for why is Struts 2 better than Struts 1, to me, if you had never used Struts 1, you may not really appreciate what Struts 2 is doing for you now.

...for that matter, how does it compare with a well-designed web application written using only JSPs, Servlets, JSTL, EL and Design Patterns ?

Struts 1 or 2 is an implementation of design pattern (MVC). You could always build your own application framework from scratch, but why do it when you could pick Struts or Spring off the shelf and use it? Essentially to develop a web application, you could either develop everything yourself or be a director and piece together the right tools available to help you shorten the time and effort needed. Yes, no doubt you could design and develop a good application framework, but why duplicate the effort if there's no value add. It really depends on what is your job. Is your job to design and build application framework or web application. If it is to build web application, you're better off picking up a mature, well tested and widely use framework such as Struts.
Iván Párraga
Ranch Hand

Joined: Dec 02, 2007
Posts: 54
Great comparative! Thanks for the link!

I've not used Struts 2 yet but I can see that most of the problems I encountered with the version 1 have been addressed now.

I'm impatient to have the opportunity to use it in a new project.

Cheers,

Iv�n
chad michael davis
Author
Greenhorn

Joined: Mar 01, 2006
Posts: 27
I think that most of the comparisons, such as Raible's, don't really get into enough detail to support a choice between frameworks. These things are just to complex to do a sort of hello world comparison with. But this is just my opinion.

My advice is that you pick one that is new. You want something that reflects the latest and greatest practices, and that's not going to be in a framework more than a few years old.

I would say that Spring MVC, Struts 2, Seam etc. All of these are good, honestly.


Chad Davis<br />Co-author of Struts 2 in Action
Andr� Cedik
Greenhorn

Joined: Mar 30, 2008
Posts: 8
If you'd like to get more into the details of Matt Raibles' comparison between those frameworks you can watch his presentation from the JavaZone 2007 conference at this website:
http://www.parleys.com/display/PARLEYS/Comparing+Java+Web+Frameworks?showComments=true

Also a more up 2 date version of the pdf linked at the Apache Struts website can be found here:
http://raibledesigns.com/rd/entry/comparing_jvm_web_frameworks_presentation
There you'll also find another pdf that includes comparisons for technologies like Flex, Grails, GWT and Seam.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Originally posted by chad michael davis:
I think that most of the comparisons, such as Raible's, don't really get into enough detail to support a choice between frameworks. These things are just to complex to do a sort of hello world comparison with. But this is just my opinion.

I don't think that Matt's comparisons are based on hello world.
Matt created AppFuse project for all primary Java web frameworks.
AppFuse has Register, Login, CRUD, bookmarking, security, integration with other frameworks lablabla...
Recently, LinkedIn hire Matt to evaluate their home-developed web framework and to check whether if they can migrate to an open source framework.
I think Matt comparisons worth reading...
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Originally posted by chad michael davis:
My advice is that you pick one that is new. You want something that reflects the latest and greatest practices, and that's not going to be in a framework more than a few years old.


Agreed. If you've the luxury of using new proven technologies, do it!
chad michael davis
Author
Greenhorn

Joined: Mar 01, 2006
Posts: 27
I didn't mean to suggest that Matt Raible's comparison was on the helloworld level. I just mean that it you probably need first hand experience to make the decision, if the decision is up to you, on which framework will better suit your needs.

I guess I just don't believe that there's a hands down, objective winner. It's such a complicated matter, and that's not even considering stuff like corporate investments in technology, at the developer and codebase level. I wouldn't want to be the guy having to decided this kind of thing for a big company.
Sougata Som
Greenhorn

Joined: Apr 29, 2008
Posts: 12
Hi, Chengwei Lee. Thanks a lot for the links. I have some experience with Struts 1 but it's not extensive and I am currently working on a project which uses its own framework built from scratch. I'm relatively new to application development and I guess I'll take some time to really appreciate the pros and cons of all these different frameworks.
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
I am currently working on a project which uses its own framework built from scratch.


Personally I feel this could be a good learning experience, if you're part of the team who is doing this framework design and building. But to me, I would rather make use of whatever is available rather than reinventing the wheel.

Unless there is some compelling reasons to build a new application framework from scratch, time and effort need to be justified. There should be some or significant value add to justify the need to build a framework from scratch instead of using whatever is mature and proven out there.



 
Consider Paul's rocket mass heater.
 
subject: Struts 2 vs JSF or Velocity
 
Similar Threads
Struts 2 vs. JSTL and EL
JSP vs JSF ?!!
RichFaces vs Facelets
jsf, struts vs other frameworks
Struts vs Struts2