• 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

Why JSF?

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have worked with JSP, Struts and some web technologies. I have heard about JSF but never worked with the same. Is JSF just a set of JSP tags that help developers create JSPs easily? Does JSF have anything more than this? Also, if the main goal of JSF is to help creating complex JSPs, is JSF not suitable for a small, less complex web UI? Will it be more of a overhead?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thread discussing similar stuff.
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jaikiran pai:
Hi,
I have worked with JSP, Struts and some web technologies. I have heard about JSF but never worked with the same. Is JSF just a set of JSP tags that help developers create JSPs easily? Does JSF have anything more than this? Also, if the main goal of JSF is to help creating complex JSPs, is JSF not suitable for a small, less complex web UI? Will it be more of a overhead?



Hi Jaikiran,

JSF is a lot more than a set of tags to write JSP pages.
JSF is a full MVC (Model-View-Controller) framework for web applications, this allows you to separate the view rendering technology from the rest of the application - so you could be marking up in wml, xhtml or your own custom format.

JSF is a component-oriented, event-based framework. Component-oriented means that you can use components that have already been developed by others without having to worry about how they work and just drop them into your web page. Also, you can create your own components and reuse them throughout any of your applications.

Event-based means that JSF can respond to user interactions. E.g. if you choose a language from a drop down list (English, German, French, etc.) JSF will receive that event and can respond by returning a localised version of the page in the chosen language.

JSF also includes things like validation of user inputs, takes care of the conversion from text strings on the web page to java types (int, Object, Number, etc.), internationalisation and dynamic page navigation.

This only scratches the surface of what JSF can do. It is really powerful.

Regards,

Fintan
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for pointing to the thread and explaining about JSF.

Fintan Conway, you mention that JSF is component-oriented, which allows applications to reuse existing UI components. Also, it takes care of validations and internationalization. All this looks almost similar(or do i say same) to what Struts provides. So, how's JSF different from Struts or are they two different things completely?
You also, mentioned that JSF is event-oriented. This is something new and different as compared to Struts. But it certainly reminds me of JavaScript.
 
Fintan Conway
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jaikiran pai:
So, how's JSF different from Struts or are they two different things completely?
You also, mentioned that JSF is event-oriented. This is something new and different as compared to Struts. But it certainly reminds me of JavaScript.



Hi Jaikiran,

See my reply in this thread.

JSF manages the component state and events on the server side. No javascript necessary (unless you want to use javascript).

Regards,

Fintan
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Fintan Conway, that thread helped in understanding the difference. Just one final question, is it possible to use Struts as a controller framework in my application and also use JSF just as a UI framework? You might ask me, why would i want to do that. As you mention, JSF allows rendering in HTML, WML, xHTML, or own custom-defined format. So if i want to leverage this in my *existing Struts application* would i have to do away with Struts controller along with my existing UI(JSPs). Or can i continue to use Struts as my controller and let JSF handle the UI part. Just curious.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

JSF manages the component state and events on the server side



Does this mean that every event on the UI is propagated to the server? This is different from Javascript, where the events are handled by the client.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Fintan Conway:
JSF manages the component state and events on the server side.



Let me make it clear that for managing component state you can choose between server and client. You just need to configure it in your configuration file, faces-config.xml.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jaikiran pai:
This is different from Javascript, where the events are handled by the client.



Yes.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Adeel and Fintan for explaining about JSF. Really, appreciated.
reply
    Bookmark Topic Watch Topic
  • New Topic