- 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 view 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 : B
Explanation
View - This is responsible for displaying all or a portion of the data to the user.
Q 2 - Which of the following is true about Interceptors?
A - Interceptors are conceptually the same as servlet filters or the JDKs Proxy class.
Answer : C
Explanation
Both of the above statements are correct.
Q 3 - Which of the following is correct about redirect result type?
B - It is used to generate output using predefined templates.
Answer : C
Explanation
It calls the standard response.sendRedirect() method, causing the browser to create a new request to the given location.
Q 4 - How Struts 2 validation works?
C - If any errors have been added then Struts 2 will not proceed to call the execute method.
Answer : D
Explanation
All of the above statements are correct.
Q 5 - Which of the following theme comes bundled with struts 2?
Answer : D
Explanation
All of the above themes comes bundled with struts 2.
Q 6 - What is the purpose of @DoubleRangeFieldValidator annotation?
A - This annotation checks that a double field has a value within a specified range.
B - This annotation checks that a field is a valid e-mail address if it contains a non-empty String.
C - This annotation validates a supplied regular expression.
D - This annotation checks that a numeric field has a value within a specified range.
Answer : A
Explanation
This validation annotation checks that a double field has a value within a specified range. If neither min nor max is set, nothing will be done.
Q 7 - What is the purpose of @UrlValidator annotation?
A - This annotation checks that a field is a valid URL.
B - This annotation checks that a field is non-null.
C - This annotation checks that a String field is not empty
D - This annotation checks that a String field is of the right length.
Answer : A
Explanation
This validator checks that a field is a valid URL.
Q 8 - Which of the following tag generates an iterator based on the val attribute supplied?
Answer : A
Explanation
These generator tag generates an iterator based on the val attribute supplied.
Q 9 - Which of the following tag is used to get the property of a value, which will default to the top of the stack if none is specified?
Answer : C
Explanation
The property tag is used to get the property of a value, which will default to the top of the stack if none is specified.
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.