
- 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
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 Controller 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 : C
Explanation
Controller - Software Code that controls the interactions between the Model and View.
Q 2 - Which of the following is correct about dispatcher result type?
B - It is used to generate output using predefined templates.
Answer : A
Explanation
It is used to forward to a servlet, JSP, HTML page, and so on, on the server. It uses the RequestDispatcher.forward() method.
Q 3 - Which of the following components are available using ActionContext map?
A - application - application scoped variables.
B - session - session scoped variables.
Answer : D
Explanation
All of the above options are correct.
Q 4 - What types of validators are available in xml based validation in struts2?
Answer : D
Explanation
All of the above validators are available in xml based validation in struts2.
Q 5 - Which of the following is true about exception handling in Structs?
A - Struts makes the exception handling easy by the use of the "exception" interceptor.
Answer : D
Explanation
All of the above statement are true.
Q 6 - What is the purpose of @BeforeResult 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 : B
Explanation
The @BeforeResult annotation marks a action method that needs to be executed before the result. Return value is ignored.
Q 7 - What is the purpose of @Key Annotation?
A - This annotation sets the CreateIfNull for type conversion.
B - This annotation sets the Element for type conversion.
C - This annotation sets the Key for type conversion.
D - This annotation is a marker annotation for type conversions at Type level.
Answer : C
Explanation
This annotation sets the Key for type conversion. The Key annotation must be applied at field or method level.
Q 8 - Which of the following tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace?
Answer : B
Explanation
The action tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action.
Q 9 - Which of the following tag assigns a value to a variable in a specified scope?
Answer : A
Explanation
The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a complex expression and then simply reference that variable each time rather than the complex expression. The scopes available are application, session, request, page and action.
Q 10 - To use MVC with Struts, you have to be comfortable with the standard JSP, Servlet APIs and a large & elaborate framework.
Answer : B
Explanation
To use MVC with Struts, you have to be comfortable with the standard JSP, Servlet APIs and a large & elaborate framework.