- 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 not a part of Struts architecture?
Answer : C
Explanation
MDBs are not a part of Struts architecture.
Q 2 - Which of the following is true about web.xml?
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 - What should be the name of xml file used for validation in struts?
Answer : A
Explanation
The xml file needs to be named '[action-class]'-validation.xml.
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 @ConversionErrorFieldValidator 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 : C
Explanation
This validation annotation checks if there are any conversion errors for a field and applies them if they exist.
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 takes two or more lists as parameters and merge them all together?
Answer : C
Explanation
These merge tag take two or more lists as parameters and merge them all together.
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 - With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.
Answer : A
Explanation
With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.