• Register
3,700 points
9 2

Top 20 Struts 1.x Interview Questions (Answered) to Crack your Next Interview

1. What is Struts? Why you have used struts in your application or project.


Its is based on MVC pattern which is model view Controller pattern.
Struts is MVC design pattern, it uses Front Controller Pattern and for better flow management

2. What are the main classes which are used in struts application?


Main classes in Struts Framework are:
Action servlet: Front controller class responsible for handling the entire request.
Action class: In Action classes we have the business logic ,call to model(DB) is also done through your action class.
Action Form: it’s a java bean which represents our forms and associated with action mapping. And it also maintains the session state its object is automatically populated on the server side with data entered from a form on the client side.
Action Mapping: using this class we do the mapping between object and Action.
ActionForward: this class in Struts is used to forward the result from controller to destination.

3. What are the features of Struts?


  • Configuration MVC components

  • POJO based action

  • AJAX Support

  • Various Tag Support

  • Various Result Types

  • Integration Support

4. What are the life cycle methods of interceptor?


  • public void init()

  • public void intercept(ActionInvocation ai)

  • public void destroy()

5. What is ValueStack?


ValueStack is a stack that contains application specific object such as action and other model

6. What is ActionContext?


ActionContext is a container in which action is executed. It is unique per thread. 

7. What is ActionInvocation?


ActionInvocation is responsible to invoke action. It holds action and interceptor objects.

8. What is OGNL?


OGNL is an expression language of struts2. It stands for Object Graph Navigation Language. 

9. What are the 5 constants of Action interface?



  2. ERROR

  3. INPUT

  4. LOGIN

  5. NONE

10. What does params interceptor?


The params (also known as parameters) interceptor sets all parameters on the ValueStack.

11. What does execAndWait interceptor?


The execAndWait (also known as ExecuteAndWait) interceptor is used to display intermediate or wait result. 

12. What does modelDriven interceptor?


The modelDriven interceptor makes other model as the default object of ValueStack. By default, action is the default object of ValueStack. 

13. What does validation interceptor?


The validation interceptor performs validation checks and adds field-level and action-level error messages.

14. What are the bundled validators?


  • requiredstring

  • stringlength

  • email

  • date

  • int

  • double

  • url

  • regex


15. What is the difference between plain-validator and field-validator?


In plain-validator one validator can be applied to many fields. In field-validator many validators can be applied to single field. 

16. What is the use of jsonValidation?


The jsonValidation interceptor is used to perform asynchronous validation. It works with validation and workflow interceptors. 

17. What are the aware interfaces in struts2?


Aware interfaces are used to store information in request, session, application and response objects. The 4 aware interfaces are given below:

  • ServletRequestAware

  • ServletResponseAware

  • SessionAware

  • ServletContextAware

20. What is Action Context Hyper?


ActionContextHyper is a container in which action is executed. It is unique per thread. 





3,700 points
9 2