This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts vs JSF

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • 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.

Thanks.
[ December 27, 2008: Message edited by: Arjun Reddy ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Pankaj Misra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic