- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 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 - What are the Struts2 error message keys that can come during file uploading process?
A - struts.messages.error.uploading
B - struts.messages.error.file.too.large
Answer : D
Explanation
All of the above are Struts2 error message keys that can come during file uploading process.
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 @ConversionErrorFieldValidator 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 : C
Explanation
This validation annotation checks if there are any conversion errors for a field and applies them if they exist.
Q 7 - What is the purpose of @CustomValidator 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 checks that a String field is of the right length.
Answer : C
Explanation
This annotation can be used for custom validators. Use the ValidationParameter annotation to supply additional params.
Q 8 - Which of the following tag will iterate over a value?
Answer : B
Explanation
These iterator will iterate over a value. An iterable value can be any of: java.util.Collection, java.util.Iterator. While iterating over an iterator, you can use Sort tag to sort the result or SubSet tag to to get a sub set of the list or array.
Q 9 - Which of the following tag is used to render a I18n text message?
Answer : B
Explanation
The text tag is used to render a I18n text message.
Q 10 - Struts2 is popular and mature web application framework based on the MVC design pattern.
Answer : A
Explanation
Struts2 is popular and mature web application framework based on the MVC design pattern.