Struts interview questions

Struts interview questions

Below are real time frequently asked interview questions and both Struts 1 and Struts 2 questions has been included and separated by topics:

Topic 1: Struts interview questions on main feature

1. Why use Struts framework if you have better Spring MVC framework ?
2. What is Struts? Why you have used struts in your project ?
3. Explain Struts work Flow ?
4. What is MVC ?
5. What is MVC2 pattern ?
6. What is Struts framework ?
7. What are components of Struts ?
8. What are core classes of Struts Framework ?
9. What design patterns used in Struts ?
10. What directory structure of Struts application ?
11. What different kinds actions in Struts?
12. How to configure Message Resources definitions file available to Struts Framework environment ?
13. What is abstract package in Struts2 ?
14. Are Interceptors in Struts2 thread safe ?
15. What is need of Struts ?
16. Who loads struts.xml file ?
17. Which Struts2 API loads struts.xml file ?
18. What are classes used in Struts ?
19. What is struts.devMode and why it is used ?
20. What is different actions available in Struts?
21. What are various Struts tag libraries ?
22. What are loopholes of Struts ?
23. How combine Struts with Velocity Template ?
24. Why need Struts ?
24. How Struts work ?
25. Is Struts compatible with other Java technologies ?
26. Who wrote Struts ?
27. Why is it called Struts ?
28. Where can I get copy of Struts ?
29. How you install Struts ?
30. When need struts.jar on your class path ?
31. Does Struts include its own unit tests ?
32. How create elements of jsp dynamically based on results data base query using struts framework ?
33. Advantages and disadvantages of JSF and Struts ?
34. Where can I get help with Struts?
35. Why Struts tags maintained part of Jakarta Tag libs project ?
36. Are Struts tags XHTML compliant ?
37. Will Struts tags support other mark-up languages such as WML ?
38. Do we need to pay Struts if being used in commercial purpose ?
39. What are core classes of Struts ?
40. How Struts control data flow ?
41. What configuration files are used in Struts ?
42. Is Struts efficient ?
43. Is there any good IDE to use with Struts ?
44. Why was reload removed from Struts ?
45. What are important tags of struts-config.xml ?
46. How to forward request to other page using Struts ?
47. How to include response from other page using Struts ?
48. Can we change name of Struts-config.xml file as Struts Configuration ?
49. How exceptions are handled in struts ?

Topic 2: Struts interview questions on action

1. Name various Action classes in Struts ?
2. What is role of Action Class ?
3. In which method of Action class business logic executed ?
4. How to get data from velocity page in action class ?
5. Write code of any Action Class ?
6. Use Action.execute and Action.getResources method?
7. What is role of Action or Model ?
8. What if element has declaration with same name as global forward ?
9. How to use forward action to restrict Struts application to MVC ?
10. What steps used to set-up dispatch action ?
11. What are action errors ?
12. How do you configure annotation based action mapping ?
13. Which interceptor is responsible for setting action JavaBean properties ?
14. Does Struts2 implement Action interface in action classes keep default Action method execute ?
15. What is action scope and how different from request scope ?
16. Can I have Action without form ?
17. What is DispatchAction ?
18. How to use DispatchAction ?
19. What is DispatchAction Struts1 equivalent in Strtus2 ?
20. What use of ForwardAction ?
21. What is IncludeAction ?
22. What is use of LookupDispatchAction ?
23. What is SwitchAction ?
24. How can I chain Actions ?
25. What is ActionServlet ?
26. What is role of ActionServlet ?
27. What is ActionMapping ?

Topic 3: Struts interview questions on difference

1. Difference between Action and ActionSupport ?
2. Difference between reset and validate method ?
3. Difference between DispathAction and LookupDispatchAction ?
4. Difference between empty default name space and root name space ?
5. Difference between Struts and Spring MVC framework ?
6. Difference between ForwardAction and IncludeAction ?
7. Difference between ActionForm and DynaActionForm ?
8. Difference between Struts and Turbine ?
9. Difference between Struts and Espresso ?
10. Difference between EL and OGNL ?
11. Difference between ActionContext and ServletActionContext ?
12. Difference between empty default name space and root name space ?
13. Difference between RequestAware and ServletRequestAware interface ?
14. Difference between DispatchAction and dynamic method invocation Struts2 ?
15. Difference between Interceptors and Filters ?
16. Difference between Html tags and Struts specific HTML Tags ?
17. Difference between session scope and request scope when saving FormBean ?
18. Difference between Struts 1 and struts2 ?
19. Difference between and ?

Topic 4: Struts interview questions on MVC

1. What are other MVC web framework have you used apart from Jakarta Struts example Spring Wicket etc ?
2. What is MVC ?
3. How is MVC design pattern used in Struts framework ?
4. What are Pull-MVC and push-MVC based architecture ? Which architecture does Struts2 follow ?

Topic 5: Struts interview questions on application

1. What main classes which used in struts application ?
2. How exceptions handled in Struts application ?
3. How validation is performed struts application ?
4. Can we have more than one struts-config.xml file for single Struts application ?
5. What is modular application ? What module-relative mean ?
6. Do I have to use JSPs with my application ?
7. What is default Sub-application ?
8. What is best way to deal with migrating large application from Struts to JSF ? Is there any tool support that can help ?
9. How exceptions handled in Struts application ?

Topic 6: Struts interview questions on error message

1. How to display error page using Struts ?
2. How to display validation errors on jsp page ?
3. How you will display validation fail errors on jsp page ?

Topic 7: Struts interview questions on design

1. Which design pattern Interceptors in Struts2 is based on ?
2. What design role played by Struts?
3. What design patterns are used in Struts?

Topic 8: Struts interview questions on validator

1. What is Struts Validator Framework?
2. Give Details of XML files used in Validator Framework?
3. Can you give simple example of using validator required rule ?
4. What Validate and reset method does ?
5. When is best time validate input ?
6. How can avoid validating form before data is entered ?
7. How you will enable front-end validation based on xml in validation.xml ?

Topic 9: Struts interview questions on ActionForm

1. What is ActionForm ?
2. What are important methods of ActionForm ?
3. What is life cycle of ActionForm ?
4. Do I have to separate ActionForm bean for every HTML form ?
5. How you can retrieve value which set JSP Page in case of DynaActionForm ?
6. Can I use multiple HTML form elements with same name ?
7. Why focus feature on tag work in every circumstance ?
8. Can I use JavaScript to submit form ?
9. In how many ways duplicate form submission can occurs ?
10. What helpers in form of JSP pages are provided in Struts framework ?
11. Can I use other beans or hashmaps with ActionForms ?
12. Do ActionForms have to true JavaBeans ?
13. What is DynaActionForm ?
14. What steps need to use DynaActionForm ?
15. What is life cycle of ActionForm ?

Topic 10: Struts interview questions miscellaneous

1. What is use of ?
2. If framework not do what I want can I request that feature be added ?
3. Tell me about JSTL and JavaServer Faces ?
4. Why are some of class and element names counter-intuitive ?
5. Can create some of my JavaBeans in JSP using a scriptlet?
6. How can you scroll through list of pages like search results in goggle ?
7. Why does tag URL encode JavaScript and mail to links ?
8. Why option tag render selected=selected instead of just selected ?
9. How to create wizard work flow?
10. What is declarative Exception Handling ?
11. What resources keep under WEB-INF folder ?
12. Are Interceptors and Filters different ?
13. In Struts1 front controller was Servlet but in Struts2 it is filter What is possible reason to change it to filter ?
14. Which class is front controller Struts2 ?
15. How does Interceptors help achieve Struts2 better framework than Struts1 ?
16. What is relation between ValueStack and OGNL ?
17. Can annotation based and XML based configuration of actions coexists ?
18. How do you get HttpServletRequest object in interceptor ?
19. What is execute and wait interceptor ?
20. Does order in which interceptors execute matters ?
21. What is life cycle of Interceptor ?
22. Which class in Struts2 executes interceptors ?
23. In what order interceptors execute in interceptor stack ?
24. What happens if not call invoke() method in any interceptors intercept method ?
25. How can two interceptors in stack communicate or If you were to pass some value from one interceptor to another ?
26. What is dynamic method invocation ?
27. How many different ways can you retrieve request parameters from within interceptor ?
28. What are Custom tags?

2 thoughts on “Struts interview questions

Leave a Reply

Your email address will not be published. Required fields are marked *