• 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 ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Why JSF and Struts together?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I read about JSF, the authors always stress that JSF does not replace Struts, and they are meant to work together. However, why would one want to do that? Doesn't JSF do everything that Struts does? What does Struts offer that JSF does not?
Thanks,
Adrian
 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also have the same question...I also found a "Struts-Faces" code base. What's that all about?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

From the FAQ:
The inventor of Struts, Craig McClanahan, was a member of the expert group for the JavaServer Standard Tag Library (JSR 052) and is now the specification co-lead for JavaServer Faces (JSR 127). Both technologies are complementary to Struts.
The mainstay of the Struts framework is the controller components, which can be used with any Java presentation technology. As new technologies become available, it is certain that new "glue" components will also appear to help these technologies work as well with Struts.
Struts originally came bundled with a set of custom JSP tags. Today, several extensions are available to help you use Struts with other popular presentation technologies, like XSLT and Velocity. Likewise, extensions for JSTL and JSF are now available as well.
The JSTL reference implementation is available through the Jakarta Taglibs site. A JSTL taglibs for Struts, Struts-El , is available and distributed with Struts beginning with the 1.1 release.
Meanwhile, the JSF specification is still under development, although an early-release reference implementation is available through the Java Web Services Developer Pack. An early-release JavaServer Faces taglib for Struts, Struts-Faces , is also in early release and available through the nightly build.

 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adrian Pang:
What does Struts offer that JSF does not?

A time-tested implementation? We have to remember that JSF is only now starting to become a viable choice for real-world applications. Struts has been around for years (although not for that many years).
In fact, Craig McClanahan has been suggesting that people should not migrate on-going Struts projects to JSF but should seriously consider using JSF for new projects.
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am doing some reading for JSF and looks like JSF by itself can not stand for a new project.
Definitely it needs to be "considered", but it should not be "considered by iteself".
Kishore.
 
Author
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kishore,
JSF is intended to be used on its own. The Struts integration was initially used to provide navigation semantics because JSF had none. With EA4 JSF got its own navigation capabilities and now (at 1.0) is completely self sufficient. There is no need to use the Struts integration.
Some time ago during the JSF book promo (over at the JSP discussion) we talked extensively about this topic.
Currently I'd only recommend using the two together if you have a legacy Struts app and need to put some JSF components on the front end.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Talk about reviving an old thread. I'm looking for more comments on this subject. I currently have a lot invested in Struts. With those Struts apps, I plan on adding JSF but will continue using Struts at the core. I talked to Craig at JavaOne 2004 and I spoke to him saying that I really liked Struts, the devs on my team are very comfortable with it. I told him that after spending a small amount of time with JSF, I felt that I wanted Struts to stay at the center of our apps and use JSF for rapid development of screens and simple validation. He was definitely supportive of that philosophy. But I did neglect to ask what advantage would I gain by developing new applications in a pure JSF environment? If you have Struts experts in house, why go pure JSF? Why not use what helps you develop faster from JSF, and stick with what you have in Struts? I'm a rookie with JSF, so I'd like to hear if I am incorrect in my thoughts. Thanks for any input. I really appreciate it.
reply
    Bookmark Topic Watch Topic
  • New Topic