- 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 feature is present in Struts 2?
A - Easy integration with Spring, Tiles and SiteMesh frameworks.
Answer : D
Explanation
All of the above features are supported in Struts 2.
Q 2 - Which of the following can be achieved using interceptors?
A - Providing preprocessing logic before the action is called.
B - Providing postprocessing logic after the action is called.
C - Catching exceptions so that alternate processing can be performed.
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 comes bundled with struts 2?
Answer : D
Explanation
All of the above themes comes bundled with struts 2.
Q 6 - What is the purpose of @DateRangeFieldValidator 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 : D
Explanation
This validation annotation checks that a date field has a value within a specified range.
Q 7 - What is the purpose of @StringLengthFieldValidator 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 String field is of the right length.
Answer : D
Explanation
This validator checks that a String field is of the right length. It assumes that the field is a String. If neither minLength nor maxLength is set, nothing will be done.
Q 8 - Which of the following tag generates an iterator based on the val attribute supplied?
Answer : A
Explanation
These generator tag generates an iterator based on the val attribute supplied.
Q 9 - Which of the following class acts as Dispatcher class in struts and spring integration?
A - org.springframework.web.context.ContextLoaderListener
Answer : B
Explanation
org.apache.struts2.dispatcher.FilterDispatcher acts as Dispatcher class in struts and spring integration.
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.
To Continue Learning Please Login
Login with Google