- 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
EJBs are not a part of Struts architecture.
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 the Model 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 : B
Explanation
If you are using model objects in your struts application, the current model object is placed before the action on the value stack.
Q 4 - Which of the following is true about internationalization?
B - The internationalization process is sometimes called translation or localization enablement.
Answer : C
Explanation
Both of the above statements are correct.
Q 5 - Which class of struts is responsible to converts data types from string?
Answer : A
Explanation
StrutsTypeConverter class tells Struts how to convert Environment to a String and vice versa by overriding two methods convertFromString() and convertToString().
Q 6 - What is the purpose of @EmailValidator 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 : B
Explanation
This validation annotation checks that a field is a valid e-mail address if it contains a non-empty String.
Q 7 - What is the purpose of @Element Annotation?
A - This annotation sets the CreateIfNull for type conversion.
B - This annotation sets the Element for type conversion.
C - This annotation can be used for custom validators.
D - This annotation is a marker annotation for type conversions at Type level.
Answer : B
Explanation
This annotation sets the Element for type conversion. The Element annotation must be applied at field or method level.
Q 8 - Which of the following tag performs basic if-else conditional flow?
Answer : A
Explanation
These tags perform basic condition flow found in every language. 'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else' Tag.
Answer : A
Explanation
Struts uses the DOJO framework for the AJAX tag implementation.
Answer : A
Explanation
Tag markups in Struts2 can be tweaked using Freemarker templates. This does not require JSP or java knowledge. Basic HTML, XML and CSS knowledge is enough to modify the tags.