- Struts provides centralized controller and centralized xml file to configure all actions, plug-in ,form bean etc. and also provides XML or properties file in which we can write valuable information rather than hard-code into our java code file.
- Struts2 also provides centralized controller .A network security developer have to focus only security and traffics so it is easy to handle it as in Struts there is only one serevlet controller.
Maintaining and development:
- As in struts, There is clear separation of model, view and controllers so its maintaining cost is low and at development time GUI
- Developer have focus only GUI ,business logic developer have focus on writing business logics and controller developer have focus on only networks securities ,traffics etc.Our developer can work on different mode, views and controllers .So it will take less time.
- We can assign different task on the behalf of the skill set so development cost can be optimized.There is clear separations between presentation and transaction layers so it’s allow us change the look and feel of applications without recompiles models.As MVC lets us allow multiple types of views all can use same server-side code. Struts used MVC-2.
When we are using JSP to send form data we have use property=”*” with jsp:setProperty .This will automatically populate data a JavaBean component based on incoming request parameters. Unfortunately there is no any standard API throught wich we can do this into serevlets. 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.
Apache Struts provides a set of Bean tags (bean:write, in particular) that let us easily output the properties of JavaBeans components.Apache Struts provides a set of HTML 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:
Fast Deployment :-
In struts development time can be significantly reduced.
Advantage Utilities :-
Struts provides lots of utilities derived from Apache commons to make our life easier like ready made Form Beans for request parameters,Validation controls and Custom tags