- 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 action tag in struts.xml?
A - We define action tags corresponds to every URL we want to access.
Answer : C
Explanation
Both 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 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 represents minimal theme with no "bells and whistles".?
Answer : A
Explanation
simple theme - A minimal theme with no "bells and whistles". For example, the textfield tag renders the HTML tag without a label, validation, error reporting, or any other formatting or functionality.
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 @Validations 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 checks that a String field is not empty
D - This annotation checks that a String field is of the right length.
Answer : B
Explanation
If you want to use several annotations of the same type, these annotation must be nested within the @Validations() annotation.
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 will allow you to format a Date in a quick and easy way?
Answer : A
Explanation
The date tag will allow you to format a Date in a quick and easy way.
Q 10 - The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.
Answer : B
Explanation
The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.