- 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
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 is true about struts-config.xml?
B - In controller section, you can configure Struts internals.
Answer : D
Explanation
All of the above statements are correct.
Q 3 - Which of the following is correct about the Named 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 : C
Explanation
These objects include #application, #session, #request, #attr and #parameters and refer to the corresponding servlet scopes.
Q 4 - Can you override the default error message that can come during file uploading process?
Answer : A
Explanation
You can override the text of these messages in WebContent/WEB-INF/classes/messages.properties resource files.
Q 5 - Which of the following theme is the default theme used by Struts 2?
Answer : B
Explanation
xhtml theme - This is the default theme used by Struts 2 and provides all the basics that the simple theme provides and adds several features like standard two-column table layout for the HTML, Labels for each of the HTML, Validation and error reporting etc.
Q 6 - What is the purpose of @ExpressionValidator 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 : C
Explanation
This non-field level validator validates a supplied regular expression.
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 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.
Answer : A
Explanation
Struts uses the DOJO framework for the AJAX tag implementation.
Answer : B
Explanation
Struts2 offers integrated profiling to debug and profile the application. In addition to this, Struts also offers integrated debugging with the help of built in debugging tools.
To Continue Learning Please Login
Login with Google