Struts2 is one of the mostly used framework for the Java application development. The struts2 framework is developed by the Craig McClanahan and later he handed it over to the Apache Foundation. Struts2 is basically said to be the combination of two frameworks webwork and struts1.
Struts2 is completely different as compare to Struts1 Framework. Struts2 is a famous MVC(Model-View-Controller) based framework. Struts2 is based on Pull-MVC based architecture. In Pull-MVC based architecture data is saved in the action or value stack and pull by the view layer to render the data for the user. We can define MVC as follows :
Model : Model represent the application's data, you can call the POJO class as a model.
View : View layer is responsible to represent the data to the users.
Controller : Controller acts as a link between the Model and View. User request lands to the Controller and after process it sends the data to the view layer. We can also say that Controller handles the flow of the data.
Features of the Struts2 Framework :
POJO based Actions : You can receive the input directly in the POJO class and validate it there.
Configurable : Struts2 is a configurable framework. The configurable file is struts.xml
Ajax Support : Struts2 supports the Ajax based actions, It can send the asynchronous request.
Easily Integrable : We can integrate different frameworks in Struts2 like spring, hibernate, tiles etc.
Template Support : Struts2 supports the templates and themes.
Tag Support : Struts2 has its own tag library which makes easy to handle the data in view layer.
Plugin Support : Struts2 supports the plugins.
Support different view technologies : In Struts2 we can use any of view technology like JSP, Freemarker,Velocity etc.