• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JSF vs Struts

 
Ranch Hand
Posts: 47
MyEclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While Going through JSF stuff, i got to know JSF is more complex and there some pit falls also. So considering those pit falls and complications, What makes JSF a great tech. to land.

Thanks

Mukuk
 
author
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I'd agree that Faces is more complex - meaning harder to use in all cases. Building very basic Faces apps is very trivial and on par and perhaps even easier than Struts.

I would say that Faces is more sophisticated though. This is due to the fact that it provides more technology with its UI component model. This is where the power of Faces can be observed especially when you look at the growing collection of powerful Faces components that are being offered such as MyFaces (Tomahawk, Trinidad ..) as well as WebGalileo, ESRI, Sun's Studio components etc..

-Chris
 
Muks Sam
Ranch Hand
Posts: 47
MyEclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Chris for explanation.
 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Copy-paste from: http://courses.coreservlets.com/ -- Hands-on, customized training for Java, servlets, JSP, Struts, and JSF.

Advantages of JSF (vs. Struts):
Custom components
� JSF makes it relatively easy to combine complex GUIs
into a single manageable component; Struts does not
� Support for other display technologies
� JSF is not limited to HTML and HTTP; Struts is
� Access to beans by name
� JSF lets you assign names to beans, then you refer to
them by name in the forms. Struts has a complex process
with several levels of indirection where you have to
remember which form is the input for which action.
� Expression language
� The JSF expression language is more concise and
powerful than the Struts bean:write tag.
� This is less advantageous if using JSP 2.0 anyhow.
Simpler controller and bean definitions
� JSF does not require your controller and bean classes to
extend any particular parent class (e.g., Action) or use
any particular method (e.g., execute). Struts does.
� Simpler config file and overall structure
� The faces-config.xml file is much easier to use than is the
struts-config.xml file. In general, JSF is simpler.
� More powerful potential tool support
� The orientation around GUI controls and their handlers
opens possibility of simple to use, drag-and-drop IDEs

Disadvantages of JSF (vs. Struts):
Established base and industry momentum
� Struts has a large core of existing developers and momentum among
both developers and IT managers; JSF does not.
� Support for other display technologies
� JSF is not limited to HTML and HTTP; Struts is
� Hey! Didn't I say this was an advantage of JSF?
� Confusion vs. file names
� The actual pages used in JSF end in .jsp. But the URLs used end in
.faces or .jsf. This causes many problems; in particular, in JSF
� You cannot browse directories and click on links
� It is hard to protect raw JSP pages from access
� It is hard to refer to non-faces pages in faces-config.xml
� Self-submit approach
� With Struts, the form (blah.jsp) and the handler (blah.do) have
different URLs; with JSF they are the same. Many developers find
this clumsy.
Less current tool support
� Struts is supported by many widely used IDEs; JSF is not (yet)
� No equivalent to Tiles
� Struts comes with a powerful page layout facility; JSF does not
� But you can extract Tiles from Struts and use it with JSF
� Much weaker automatic validation
� Struts comes with validators for email address, credit card numbers,
regular expressions, and more. JSF only comes with validators for
missing values, length of input, and numbers in a given range.
� But MyFaces has several powerful validators
� Lack of client-side validation
� Struts supports JavaScript-based form-field validation; JSF does not
� Worse installation
� JSF does not have equivalent of struts-blank to start with
� POST only
� JSF does not support GET, so you cannot bookmark results pages

JSF and Struts: The Future:
Possibilities
� JSF will fail and developers that want a framework will
stick with Struts
� JSF will die
� Not impossible, since other MVC frameworks have failed already
� JSF will flourish and replace Struts
� Struts will die
� JSF will grow moderately, and developers will be split
� Both Struts and JSF will be widely used frameworks
� Prediction is difficult
� Technical factors are not usually what decide these things
� Recommendations
� Migrate ongoing Struts projects to JSF: not yet
� Start real-world JSF projects: yes, but with some caution
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic