- 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 true in the life cycle of a request in Struct2 application?
A - Selected action is executed to perform the requested operation.
B - Configured interceptors are applied to do any post-processing if required.
C - Finally the result is prepared by the view and returns the result to the user.
Answer : D
Explanation
All of the above steps are part of the life cycle of a request in Struct2 application.
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 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 - 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 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 @RegexFieldValidator annotation?
A - This annotation validates a string field using a regular expression.
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 annotation validates a string field using a regular expression.
Q 7 - What is the purpose of @Conversion Annotation?
A - This annotation checks that a field is a valid URL.
B - This annotation is used to nest several annotations of same type.
C - This annotation can be used for custom validators.
D - This annotation is a marker annotation for type conversions at Type level.
Answer : D
Explanation
This is a marker annotation for type conversions at Type level. The Conversion annotation must be applied at Type level.
Q 8 - What is the purpose of @KeyProperty 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 sets the KeyProperty for type conversion.
Answer : D
Explanation
This annotation sets the KeyProperty for type conversion. The KeyProperty annotation must be applied at field or method level.
Q 9 - Which of the following tag is used to push value on stack for simplified usage?
Answer : D
Explanation
The push tag is used to push value on stack for simplified usage.
Answer : B
Explanation
Struts2 has a great support for multiple view options (JSP, Freemarker, Velocity and XSLT).
To Continue Learning Please Login
Login with Google