Q. What are the features of Struts 2 ?
A. The complete development cycle of Struts 2, from building, to deploying, to maintaining applications  all these targets are achieved by Struts 2  by providing the following features :

Build Supporting Features
Deployment Supporting Features
Maintenance Supporting Features

Build Supporting Features

Build Supporting Features are given below:

  • Projects that are latest / new can be started easily.
  • Provide style sheet driven form tags which decrease coding effort.
  • Use Cancel button to close the current action.
  • Supports the Ajax tags.
  • Provide integration with the Spring application framework.
  • Place the binary and string properties on an Action class directly.
  • Use the JavaBeans for form inputs.
  • No need of interfaces because Controller handled the interfacing between components.
  • Use any class as an Action class.

Deployment Supporting Features

Deployment Supporting Features are given below:

  • To increase the abilities and features it allows framework extension, automatic configuration, and plugins.
  • Helps in debugging.

Maintenance Supporting Features

  • Maintenance Supporting Features are given below:
  • Directly Actions can be tested.
  • Configuration elements have default value that can be put only once.
  • To handle the request per action Controller can be customized simply.
  • For handling a new request a new class is invoked.
  • To report problems it provides built-in debugging tools.
  • Saves the time during manual testing.
  • Provide JSP, FreeMarker, and Velocity tags.

Q. What are the advantages of Struts 2 ?
A. The advantages of Struts 2 are given below:

Simple Design:- No tightly coupled code.

Easy plug-in:- Use another technologies plug-in easily such as Spring, Tiles, etc.

Simplified ActionForm:- POJOs are ActionForms, so no need to implement any interface or extend from any class.

Action Classes:- Action class implements Action interface in Struts 2 framework and another interfaces are optional.

Threading Model:- For each request it instantiated Action object, so no thread-safety issues arises.

Testability:- Struts 2 Actions can be tested by following sequence, the Action instantiate , set properties, and invoke methods . Dependency Injection (DI) makes testing easier.

Expression Language:- It uses Object Graph Navigation Language (OGNL)to obtain data from ValueStack and type conversion which decreases the code.

Annotations :- Reduction in length and complexity of code occur by the use of annotation.

Validation:- It gives manual validation as well with the support of Validate() method.

Ajax support:- Tags of Struts 2 are Ajax enabled.

Q. What are the disadvantages of Struts 2 ?
A. The disadvantages of Struts 2 are given below:

Compatibility:-
It’s difficult to move the applications from Struts 1 to Struts 2 because Struts 2 is totally different from Struts1.

Limited Documentation:-
Due to the poorly managed documentation by Apache, new users find it difficult to understand its concepts. As the  documentation is limited also.

Less Transparent:- It is less transparent and hides the details that are internal which makes code hard to understand.

Q. Explain the request processing of Struts 2 web application framework ?
A. The Struts 2 request processing can be divided into following steps:

1. When framework received a request, it matches with a configuration so that the interceptors, Action class and result class can be invoked.
2. Now the request passes through a series of interceptors and these interceptors provide a pre-processing for the request.
3. After pre-processing, a new instance of the Action class is created and the method that provide the logic for request handling is also invoked.
4. As the result is obtained, a Result class matching the return. Here, a new instance of return class is created and invoked.
5. In reverse order the response passes through the interceptors to perform any clean-up.
6. In the end, the control is returned back to the Servlet engine so that the result is available to the user.