Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Struts vs JSF

Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have found the following differences between both of them. Can someone please correct me if I am wrong?

Advantage of struts over JSF:

1).Struts is controller based and provides access to the controller.
2).Struts has tiles framework
3).More documentation or support is available online because it's an old framework compared to it's counterpart.

Advantages of JSF over struts:
1). JSF is component/view based. It provides many UI components for better UI web applications
2). Jsf application works fine on mobile phones too coz it can render to WML clients where as struts can only render to html clients.
3).Less complexity. No need to bother about all the ActionForms and ActionClasses.

[ December 27, 2008: Message edited by: Arjun Reddy ]
Saloon Keeper
Posts: 24866
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Advantage of struts over JSF:

1). Probably not. JSF has more canned controller functionality, however, so you don't need to write as much controller code.
2). I think Tiles now works with JSF, but as I mentioned in an earlier post, I prefer Facelets to do my tiling with. They look a lot alike, however.
3). Probably not, at this late date.

Advantages of JSF over struts:
1). Yup. Actually, it's as about close to true MVC as HTTP can permit.
2). Not true. I've used Struts to render up PDF's, XML and other stuff. There is even a framework for Struts that lets you select a renderer based on the client, although it's not part of basic Struts. It's actually easier in some ways to switch renderers on Struts, since you have to manually control them.
3). Fewer source files, anyway.
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I 100% agree with Tim.

Some of the other differences that can be discussed about
1. JSF is JSR-127, hence can be taken as one of the web frameworks which will be supported by all the J2EE containers

2. Though Converters can be implemented in any of the web frameworks, JSF provides many out of the box converters and interfaces to build custom converters and validators

3. Dynamic inclusion/exclusion of converters/validators and managed beans.

4. Flexibility to make custom components that can be re-used across pages.

5. Internal working of JSF is far more complex, and phase driven, In order to properly understand JSF in-and-out, one needs to understand its elaborate life cycle phases.

6. Not all navigations are simple with JSF, think about a drop down based navigation...
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic