Struts Vs JSF (A comparison of Struts against JSF)

By: Freddy Ng  


§Rich infrastructure.
§There's only one Struts
§Struts is an open-source product, whereas JSF is a specification. As young as JSF is, we have two excellent JSF implementations to choose from: the Reference Implementation from Sun and MyFaces, from Apache. On the other hand, there's only one Struts.
POJO Action Methods
§Struts actions are tied to the Struts API, but JSF action methods can be implemented in Plain Old Java Objects. In struts the form bean contains data and the action bean contains logic. OO purists want to put them together, but you can't with Struts. In JSF, you can spread out your data and logic, or put them in one object. The choice is yours.
Managed Beans
§Like Spring, JSF uses dependency injection (or inversion of control, if you will), for instantiating and initializing beans. It's true that Struts creates action beans and form beans for you, but JSF generalizes that concept and adds the ability to initialize managed beans—of any type—created by the framework.
Event Model
§JSF has an event model that lets you react to value changes, actions, and phase changes in the JSF lifecycle.
§Struts tags generate HTML directly. JSF component tags, don't generate anything; instead, they refer to a component-renderer pair on the server. The component maintains state whereas the renderer is in charge of rendering a view. The point here is that renderers are pluggable: you can replace the default renderers with your own implementations

Archived Comments

1. which book is suitable for the jsf struf
View Tutorial          By: rahul at 2012-07-25 14:57:13

Most Viewed Articles (in JSF )

Latest Articles (in JSF)

Comment on this tutorial