Java Server Faces technology is used for buiding UI for web applications.
The core value of the Struts framework is the Controller and the simplicity of customizing the Controller to suit your needs. Struts provides basic UI creation utilities via JSP tag libraries.
Struts and JSF technology work together.
The JSF JSP elements are far more advanced than the basic Struts JSP elements.
The Struts Layout tag library contains advanced JSP elements, similar to JSF.
JSF technology and three-tier applications using Business delegates and loosely coupled business objects do not go together.
> Hai Vijay.
>
> Struts is liek dosa and JSF is liek aloo parantha.
>
> okey?
Now I'm not making fun of our brown friends here, but can someone recast that explanation, using only items that can be purchased at a Kentucky Fried Chicken, so that I can understand it better?
> > Hai Vijay.
> >
> > Struts is liek dosa and JSF is liek aloo
> parantha.
> >
> > okey?
>
> Now I'm not making fun of our brown friends here, but
> can someone recast that explanation, using only items
> that can be purchased at a Kentucky Fried Chicken, so
> that I can understand it better?
Brown friends? I prefer to think of myself as "melanin-enhanced" and others as "melanin-challenged." Nonetheless, Struts can be thought of a Kentucky Fried Chicken whereas JSF is one pound of fresh, boneless chicken and a bottle of barbeque sauce.
How's that? ;-)
> > No, Yasmine Bleeth. Today is her birthday
>
> A perfect moment to post some Baywatch stills, but
> Sun has shut down that loophole.
>
> ;-(
>
> All because Poopypants inflicted some ber pwnage on
> these forums.
I created a new thread called, "thank you pooperscooper" whose first message body was "for fcking up the forums" but then decided not to hit the post button.
In case of Struts user interface can be HTML, JSP, velocity templates etc. which is having limitations. JSF overcome on this limitation by expanding AWT and Swing value of user interface component model which provide rich UI model
Advantages:
Clearly partition view tire requirements
Encapsulate complex behavior in simple components
Leverage parent-child relationship
Component can fire server side event
Components can arrange in a tree so they can take the responsibility for processing their children (input/output)
In struts, no event processing model except handling form submitsexecute(), on other hand in JSF uses standard JavaBeans event model. In JSF event listener is registered on components and components can fire events for interesting thing.
In struts, rendering has limitations
HTML tags render only HTML
HTML tags work only in HTML pages
On other hand JSF splits the responsibility for the rendering
Performed by separate renderer
Renderer kits can register renderers for differnet markup language
In Struts their is limitation on view representation strategy, only JSP is supported, although third party add-on alternative exist, while JSF supports alternative view technologies
Support for JSP available in nearly all libraries
ViewHandler extension API for alternatives:
Facelets <https://facelets.dev.java.net>
Shale Clay <https://shale.apache.org/shale-clay>
SVG, Xforms...
In Struts, a limited pulls model is supported, on other hand JSF components extend binding approach i.e. JSF can bind any component property, not just a value
Struts create ActionForm beans on demand when processing a form submit, while JSF generalizes this concept which create any bean on demand, in any scope.
In struts page navigation, based on ActionForward() returned by calling Action.excecute() method while in JSF navigation decision based on 3 criteria
Current view (same as Struts)
Value returned from action method (String)
Which action method was invoked?
Can be simulated with Struts DispatchAction
In struts, generally use of Form bean and action per page
Form bean properties are generally strings
Form beans generally stored in request scope
Form beans must extend ActionForm
Action classes are singletons
Must be thread safe
Action responsible for conversion and pushing
data to the model tier
In JSF,
Generally have a backing bean per view
No required base class or implemented interface
Typically are managed beans for easy creation
Typically stored in request scope
Can use backing bean properties for request state
or binding component instances
Components do conversion to model types
With bindings, push to model can be automatic
In struts request processing lifecycle requests are run through an instance of RequestProcessor. In JSF all request run through an configured instance of lifecycle which is more flexible in performance point of view