• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

struts and jsf difference

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The primary advantages of Struts as compared to JavaServer Faces technology are as follows:
Because Struts is a web application framework, it has a more sophisticated controller architecture than does JavaServer Faces technology. It is more sophisticated partly because the application developer can access the controller by creating an Action object that can integrate with the controller, whereas JavaServer Faces technology does not allow access to the controller. In addition, the Struts controller can do things like access control on each Action based on user roles. This functionality is not provided by JavaServer Faces technology.

please explain the above statement if possible with example clearly....

Thank you
 
Ranch Hand
Posts: 77
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The primary advantages of Struts as compared to JavaServer Faces technology are as follows:
Because Struts is a web application framework, it has a more sophisticated controller architecture than does JavaServer Faces technology. It is more sophisticated partly because the application developer can access the controller by creating an Action object that can integrate with the controller, whereas JavaServer Faces technology does not allow access to the controller. In addition, the Struts controller can do things like access control on each Action based on user roles. This functionality is not provided by JavaServer Faces technology.



Hi vinaykumar vinay,

Since you cannot access the controller in jsf technology,you are unable to update your page in the current session.

example : If you are using jsf and you want to create a calendar in which if you change the date,the content on your page changes instantly without refreshing...then you are unable t do so..but same can be accomplished in struts... hope it helps...
 
Saloon Keeper
Posts: 28410
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just be aware that JSF was designed in large part to remedy the deficiencies in Struts, and in fact, some parts of JSF were designed with the direct aid of some of the authors of Struts. There's also a "meet-halfway" project called Shale that was part of that attempt.

Both JSF and JSF are based on the MVC architecture. The main difference is that Struts employs special classes and interfaces to facilitate the creation of Models, Views, and Controllers, but JSF attempts (as much as possible) to employ POJO classes as Models, an XML-based View Definition Language for Views, and the Controllers are almost always pre-supplied.


Since you cannot access the controller in jsf technology,you are unable to update your page in the current session.

example : If you are using jsf and you want to create a calendar in which if you change the date,the content on your page changes instantly without refreshing...then you are unable t do so..but same can be accomplished in struts... hope it helps...



This is a serious misunderstanding of both JSF and Struts. Or more correctly, it's a misunderstanding of the HTTP protocol that underlies JSF, Struts, and the web in general.

HTTP is a pure request/response protocol with requests matched up to responses on a purely 1-to-1 basis. No HTTP server can ever update a web page via an unsolicited response, because not only does the HTTP standard forbid it, but because HTTP does not hold open a continuous connection the way that other client/server protocols do. In fact, it's not possible to send out unsolicited output because except while a request is being processed, there's no place to send the response to/.

We fake it these days using AJAX. But AJAX works for both Struts and JSF, and in fact, there's a thriving trade in AJAX-enabled JSF extension tagsets. To update a calendar in real time, for example, I can set a JSF polling tag in RichFaces that does a partial page refresh of just the calendar on a periodic basis. RichFaces renders an HTML page with the required AJAX code on it that does the periodic requests needed to get updated data and to re-render just the section of the page that needs to be changed.
 
vinaykumar vinay
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you for the session concept and Ajax information....

please explain the sentence which is written with bold letter...
and comparison between them with example...

thank you )
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic