
- Struts 2 Tutorial
- Struts2 - Home
- Struts2 - Basic MVC Architecture
- Struts2 - Overview
- Struts2 - Environment Setup
- Struts2 - Architecture
- Struts2 - Examples
- Struts2 - Configuration
- Struts2 - Actions
- Struts2 - Interceptors
- Struts2 - Result Types
- Struts2 - Value Stack/OGNL
- Struts2 - File Uploads
- Struts2 - Database Access
- Struts2 - Sending Email
- Struts2 - Validations
- Struts2 - Localization
- Struts2 - Type Conversion
- Struts2 - Themes/Templates
- Struts2 - Exception Handling
- Struts2 - Annotations
- Struts 2 Integrations
- Struts2 - Spring
- Struts2 - Tiles
- Struts2 - Hibernate
- Struts 2 Useful Resources
- Struts2 - Questions and Answers
- Struts2 - Quick Guide
- Struts2 - Useful Resources
- Struts2 - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Struts2 Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Struts2 Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Q 1 - Which of the following is correct definition of model in MVC architecture?
A - The lowest level of the pattern which is responsible for maintaining data.
B - This is responsible for displaying all or a portion of the data to the user.
C - Software Code that controls the interactions between the Model and View.
Answer : A
Explanation
Model - The lowest level of the pattern which is responsible for maintaining data.
Q 2 - Which of the following can be achieved using interceptors?
A - Providing preprocessing logic before the action is called.
B - Providing postprocessing logic after the action is called.
C - Catching exceptions so that alternate processing can be performed.
Answer : D
Explanation
All of the above statements are correct.
Q 3 - Which of the following is correct about Temporary Objects?
A - There are various temporary objects which are created during execution of a page.
B - The current model object is placed before the action on the value stack.
Answer : A
Explanation
There are various temporary objects which are created during execution of a page. For example the current iteration value for a collection being looped over in a JSP tag.
Q 4 - Which of the following is correct about Struts 2 validation framework?
Answer : C
Explanation
Both of the above statements are correct.
Q 5 - Which of the following theme provides all the basics that the simple theme provides and adds several features like standard two-column CSS-based layout?
Answer : C
Explanation
css_xhtml theme - This theme provides all the basics that the simple theme provides and adds several features like standard two-column CSS-based layout, using for the HTML Struts Tags, Labels for each of the HTML Struts Tags, placed according to the CSS stylesheet.
Q 6 - What is the purpose of @Before annotation?
B - This annotation marks a action method that needs to be executed before the result.
D - This annotation checks that a date field has a value within a specified range.
Answer : A
Explanation
The @Before annotation marks a action method that needs to be called before the main action method and the result was executed. Return value is ignored.
Q 7 - What is the purpose of @RequiredFieldValidator annotation?
A - This annotation validates a string field using a regular expression.
B - This annotation checks that a field is non-null.
C - This annotation validates a supplied regular expression.
D - This annotation checks that a numeric field has a value within a specified range.
Answer : B
Explanation
This validation annotation checks that a field is non-null. The annotation must be applied at method level.
Q 8 - Which of the following tag takes two or more lists as parameters and append them all together?
Answer : D
Explanation
These merge tag take two or more lists as parameters and append them all together.
Q 9 - Which of the following tag can be used to parameterize other tags?
Answer : B
Explanation
The param tag can be used to parameterize other tags.
Q 10 - The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.
Answer : B
Explanation
The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.