Struts2, is an OpenSymphony WebWork framework, is an Open source project provides an abstraction layer on top of the existing technologies called as Servlet and JSP for creating of Java based Web applications based on the MVC design pattern. Struts 2 framework is nothing but implementation of MVC-2 model on JSP.
Struts 2 framework features:
1. POJO forms and POJO actions: In struts the ActionForms were an integral part of the framework i.e. for receiving any input from the user there has to be an ActionForms. ActionForms needed lots of coding and they were a pain. But in struts2 any POJO can be used to receive the form input and also acts as an action class.
2. Tag Support: Because of the form tags like the head tag, hidden tag, label tag etc. and the new improved tags like timepicker tag(instead of datepicker) the developer has to write less codes.
3. Integration: struts2 can be easily integrated with other frameworks that are spring, tiles etc.
4. Plugin Support: By using the plugins supported by struts2, the behavior of the struts2 can be enhanced and augmented.
5. Easy to modify tags: In struts2 tag mark ups can be modified by using free mark templates. And for doing this it does not require JSP or java knowledge instead basic HTML, XML knowledge is enough to modify the tags.
6. Template Support: struts2 supports templates for generating dynamic views and pages. Three built-in themes come with struts2: simple, xhtml, and css_xhtml. By default xhtml theme is used.
8. Struct2 Support Expression Language for View: struts2 can use JSTL, but the framework also supports a more powerful and flexible expression language like JSP, XSLT, OGNL to create View pages.
9. Result Types: Various types of Results are supported by srtuts2. These are Dispatcher Result, FreeMarker Result, Stream Result Chain Result, Redirect Result , HttpHeader Result, Velocity Result, XSL Result ,Redirect Action Result, Tiles Result, PlainText Result.
10. Interceptors: The struts2 framework provides a very important feature known as “INTERCEPTOR” which can be used to control the request and response. Interceptor can be runned before and after the execution of an action.
11. Type Conversion: struts1 use Commons-Beanutils for type conversion. struts2 use OGNL for type conversion.
12. Multiple view option [JSP, velocity, Freemarker and XSLT]
13. Struts2 Classes are based on interface.
14. Struts2 use themes based tag libraries and Ajax tags.
15. In Struts2 you can get all the information about your web application as your action class, form bean and JSP page information are present in the struts.xml file so you don’t have to search for them.
16. Struts2 has inbuilt capabilities to check that the form values are in the required format or not and if the values are net in proper format then the form willautomatically display the error message.
17. Another important feature of struts2 is being an open source it is exposed to the developers which enables fast development and maintenance cycle.
18. It reduces the project development time and cost in developing the controller and view parts of the web application.