News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Advantages of Struts

Started by thiruvasagamani, Aug 28, 2008, 07:34 PM

Previous topic - Next topic

thiruvasagamani

Struts offers many advantages to the application programmer while reducing the development time and making the manageability of the application easier. Here are few key advantages of using Struts instead of managing the every layer of the web application yourself.


Centralized File-Based Configuration


Rather than hard coding information into java programs,many Struts values are represented in XML or property files. This loose coupling means that many changes can be made without modifying or recompiling Java code,and that wholesale changes can be made by editing a single file. This approach also lets Java and Web developers focus on their specific tasks (implementing business logic,presenting certain values to clients,etc.) without needing to know about the overall system layout.


Form Beans


In JSP,you can use property="*" with jsp:setProperty to automatically populate a JavaBean component based on incoming request parameters. Unfortunately,however,in the standard API this capability is unavailable to servlets,even though with MVC it is really servlets,not JSP pages,that should usually be the target of form submissions. Apache Struts extends this capability to Java code and adds in several useful utilities,all of which serve to greatly simplify the processing of request parameters.


Bean Tags


Apache Struts provides a set of custom JSP tags (bean:write,in particular) that let you easily output the properties of JavaBeans components. Basically,these are concise and powerful variations of the standard jsp:useBean and jsp:getProperty tags.


HTML tags



Apache Struts provides a set of custom JSP tags to create HTML forms that are associated with JavaBeans components. This bean/form association serves two useful purposes:

It lets you get initial form-field values from Java objects.

It lets you redisplay forms with some or all previously entered values intact.


Form Field Validation

Apache Struts has built-in capabilities for checking that form values are in the required format. If values are missing or in an improper format,the form can be automatically redisplayed with error messages and with the previously entered values maintained.

This validation can be performed on the server (in Java),or both on the server and on the client (in JavaScript).

Struts 2.0 is currently in beta phase and contains the existing Struts features plus all the features of WebWorks framework.
Thiruvasakamani Karnan