This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes JSF and Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSF and Struts " Watch "JSF and Struts " New topic

JSF and Struts

Juan M.

Joined: Jan 04, 2005
Posts: 6

I'm trying to get a clear view of what Struts and JSF are for.

After reading Craig McClanahan's Weblog I think I got a clear view of what Struts and JSF are for.

If I understood it correctly, Struts is, by no way, something you can just avoid if you would like a MVC design in your web page (well, you can use another framework or your own, but certainly JSF doesn't provide a solution for it). In fact, JSF only provides the proper tags for the view tier. In this area, Struts tags and JSF overlap, but just in this area. JSF don't touch the controller area (or client-side validation). So, there is no JSF vs. Struts when you are considering using a MVC framework and you like Struts.

Have you used both ? Is this correct ?

Thanks in advance,

- Juan

[ January 11, 2005: Message edited by: Juan M. ]
[ January 11, 2005: Message edited by: Juan M. ]
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

In O'Reilly's JavaServer Faces book, Hans Bergsten refers to Struts as an application framework and JSF as a User Interface framework. The former acts as a traffic cop of HTTP requests while the latter focuses on the user interface details.
"There's some overlap between Struts and JSF, though. Both define mechanisms for page navigation and validation, for instance, but they are so flexible that you can pick and choose which should be in charge of these tasks."

A good workman is known by his tools.
Juan M.

Joined: Jan 04, 2005
Posts: 6
Thank you for your help. Would you advise to buy the Hans Bergsten's book you mention or David Geary's Java Server Faces ? I was looking for a good book about JSF but didn't know which one to read.
I agree. Here's the link:
subject: JSF and Struts
It's not a secret anymore!