- 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 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 struts-config.xml?
B - In form-beans section, you can map your ActionForm subclass to a name.
C - In global-forwards section you can map a page on your webapp to a name
Answer : D
Explanation
All of the above statements are correct.
Q 3 - Which interceptor is responsible for file upload support?
Answer : A
Explanation
File uploading in Struts is possible through a pre-defined interceptor called FileUpload interceptor which is available through the org.apache.struts2.interceptor.
Q 4 - How Struts 2 validation works?
C - If any errors have been added then Struts 2 will not proceed to call the execute method.
Answer : D
Explanation
All of the above statements are correct.
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 @BeforeResult 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 : B
Explanation
The @BeforeResult annotation marks a action method that needs to be executed before the result. Return value is ignored.
Q 7 - What is the purpose of @RequiredStringValidator annotation?
A - This annotation validates a string field using a regular expression.
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 numeric field has a value within a specified range.
Answer : C
Explanation
This validation annotation checks that a String field is not empty (i.e. non-null with a length > 0).
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.
Q 9 - Which of the following tag is used to get the property of a value, which will default to the top of the stack if none is specified?
Answer : C
Explanation
The property tag is used to get the property of a value, which will default to the top of the stack if none is specified.
Q 10 - Struts2 promotes less configuration with the help of using default values for various settings.
Answer : A
Explanation
Struts2 promotes less configuration with the help of using default values for various settings. You don't have to configure something unless it deviates from the default settings set by Struts2.
To Continue Learning Please Login
Login with Google