|
Answer» In a nutshell, Faces has the following advantages over Struts:
- Eliminated the NEED for a Form Bean
- Eliminated the need for a DTO Class
- Allows the use of the same POJO on all Tiers because of the Backing Bean
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.
- Struts includes a powerful layout management framework, called Tiles, which allows you to create templates that you can reuse across multiple pages, thus enabling you to establish an overall look-and-feel for an application.
- The Struts validation framework includes a larger set of standard validators, which automatically generate both server-side and client-side validation code based on a set of rules in a configuration file. You can also create custom validators and easily include them in your application by adding definitions of them in your configuration file.
The greatest advantage that JavaServer Faces technology has over Struts is its flexible, extensible UI component model, which includes:
- A standard component API for specifying the STATE and BEHAVIOR of a wide range of components, including simple components, such as input fields, and more complex components, such as scrollable data tables. Developers can also create their own components based on these APIs, and many third parties have already done so and have made their component LIBRARIES publicly available.
- A separate rendering model that defines how to render the components in various ways. For example, a component used for selecting an item from a list can be rendered as a menu or a set of radio buttons.
- An event and listener model that defines how to handle events generated by activating a component, such as what to do when a user clicks a button.
- Conversion and validation models for converting and validating component data.
In a nutshell, Faces has the following advantages over Struts: The primary advantages of Struts as compared to JavaServer Faces technology are as follows: The greatest advantage that JavaServer Faces technology has over Struts is its flexible, extensible UI component model, which includes:
|