Struts Vs JSF (A comparison of Struts against JSF)
By: Freddy Ng
Components
§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.
§
Renderers
§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
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Struts Vs JSF (A comparison of Struts against JSF)
Calling Multiple Listeners in JSF
<convertNumber> and <convertDateTime> in JSF
faces-config.xml to DirectTraffic in the JSF Application
JSF - TreeNode.setID gets IllegalArgument Exception
Servlet error : java.lang.IndexOutOfBoundsException (JSF RI 1.1_01: IndexOutOfBoundsException)
How to open a new browser window from my JSF page?
Accessing Context Data in Beans using JSF
Install and Deploy JBoss Application Server
Controlling Page Navigation in JSF - Static and Dynamic Navigation