
- 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 true in the life cycle of a request in Struct2 application?
A - Selected action is executed to perform the requested operation.
B - Configured interceptors are applied to do any post-processing if required.
C - Finally the result is prepared by the view and returns the result to the user.
Answer : D
Explanation
All of the above steps are part of the life cycle of a request in Struct2 application.
Q 2 - Which of the following is true about web.xml?
Answer : C
Explanation
Both 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 - 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 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 @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 @CreateIfNull Annotation?
A - This annotation sets the CreateIfNull for type conversion.
B - This annotation is used to nest several annotations of same type.
C - This annotation can be used for custom validators.
D - This annotation is a marker annotation for type conversions at Type level.
Answer : A
Explanation
This annotation sets the CreateIfNull for type conversion. The CreateIfNull 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.
Q 9 - Which of the following tag is used to create a URL?
Answer : C
Explanation
The url tag is used to create a URL.
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.