Struts2 Tutorial

The Struts2 is an Open Source web based framework based on Model View Controller (MVC) Design Pattern. The latest stable version of Struts is Struts 2. This project is from Apache and is combination of WebWork 2 and Struts 1. It is highly extensible and flexible framework for web application development.

The key features of Struts 2 are Interceptors, Result Types, easy integration with other framework through plug-in, data validations at client or server side, implementation of Inversion of Control (IoC), Internationalization, and Tiles integration etc. It is a web application framework with tools, and API for creating web application. It implements Front Controller (FC) approach like - Struts 1 and String Web MVC framework.

The Struts 2 action classes are core concepts and represents Model class itself which contains business logic for processing on the data. Action classes act as controller in the MVC (Model View Controller) pattern.
More
The Inversion of Control (IoC) and Dependency Injection (DI) are programming design pattern, which is used to reduce compiling in computer programs. You do not create object, only describe how to use objects. The container creates the required object whenever is required.
More
The Struts2 framework provides very important features known Interceptor. It is used to controlling request and response. The Interceptor executed before and after the Action. So It can be used to process some logics on the request before Action and after Action also. It is same as Filter concept of J2EE application. Most of the framework implemented the interceptor functionality.
More
The Struts2 framework provides powerful tag libraries to create view pages. It can be used to create view pages in very easy.
After executing the Action class, the target view page will be executed based on configuration in struts.xml. The Struts 2 framework provides set of Result types like, chaining, dispatcher, redirect action, velocity and freemarker etc
More
The exception handling is the common task in any Java based application. The Struts 2 framework provides the simple way to handle any uncaught exceptions generated by a web application and also provides robust exception handling, including the ability to automatically log any uncaught exceptions and redirect the user to a error web page.
More
Struts 2 framework provides feature to execute method from action class dynamically. Suppose you have five methods (execute, add, delete, update and query) in action class and want to configure in struts.xml file.
More
The Struts 2 framework provides excellent validation feature. It can be configured vie XML of annotations. You can validate data in action class also through validate () method. The validation concept depends on the validation and workflow interceptor; both are part of the default interceptor stack.
More
The Struts 2 provides feature t for web application can created for global use. The web content will be changed according to the language selection by the user at run time. To implement the above concept, Struts2 Internationalization and localization is used.
More
The Apache Tiles is templating framework is used to design several pages in easiest way. It provides features to divide entire page in different sections including title and page can be inserted in the sections at run time. It is used for same look and feel of several pages.
More
The Struts2 framework scans Action class in classpath using Convention Plug-in. You can use annotations in action class for mapping rather than configuration file struts.xml.
More
The Hibernate is most popular ORM (Object Relational Mapping) framework in the market. You can integrate it in all Java/J2EE based framework. You can develop with xml configuration or with annotations.
More
You can inject Session and Transaction in DAO class and it can be configured using annotations, xml and both.
More
Spring is an Open Source lightweight framework works with all tier software application layers. It provides container to manage bean and uses Dependency Injection (DI).
More

  Next