• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 vs JSF

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

I don't know if it would be meaningful to compare 'em both. But i need to know what are all that JSF can do that can't be done with s2.

And, do learning jsf rather struts2 makes one more valulable in the market?

I'm pretty comfortable with S2 and like to know if jsf could make things better.

N.B: I'm just a beginner and Nothing offensive. Just to know the better option.
 
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no better one. Given a project scenario, one might be a more applicable choice than another.
For job markets it's better to be someone who understands most popular frameworks well and both are popular but it ultimately goes down to the candidate companies that can employ you. If the companies in your area that are likely to employ you use wicket or some other framework then it makes no difference to you if the rest of the world is using JSF or struts.
 
Vijaya Ragavan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you pal...
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF was designed in part by the authors of Struts to create a "Struts" that did a more accurate implementation of MVC (Struts is technically "Model 2") and to get rid of all the interface and subclass dependencies. The idea being that POJOS are more re-usable and easier to unit-test offline than framework-dependent code. Which is why I chant endlessly:


The more JSF-specific code that is in your JSF webapp, the more likely it is that you're doing it wrong.



The other thing that the Struts folks didn't like about Struts was that you had to define too many classes for each component. In JSF, you define a view template file, a backing bean (model), and that's basically it. There's no separate "action" class to transition data in and out of the MVC part of the webapp, just POJO methods that are defined in the same class as the POJO model.

My gut feeling is that Struts can probably process faster on heavier workloads, but I have no stats to confirm or deny. JSF is much better when you are primarily working with data entry forms, as it automatically populates the forms, validates the forms, reports invalid data without requiring user-written code, and propagates the form data (View control values) to the backing bean (Model) when (and only when) all form values are valid.

Neither Struts nor JSF are "greedy" frameworks that require total ownership of the application. You can mix Struts and JSF and regular servlets/JSPs with impunity, and in fact, when you are attempting to output non-form content such as PDFs, Word documents or spreadsheets, it is far better to avoid cramming them through JSF and use a straight servlet to generate those types of data.

As for the job market, locally I see about a 50/50 split between Struts and JSF right now. A lot of the Struts stuff is older apps. You may see different demands depending on where you are located.
 
Vijaya Ragavan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is kind of an explanation which i needed pal. Thanks a lot..!
 
reply
    Bookmark Topic Watch Topic
  • New Topic