- 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 correct definition of view in MVC architecture?
A - The lowest level of the pattern which is responsible for maintaining data.
B - This is responsible for displaying all or a portion of the data to the user.
C - Software Code that controls the interactions between the Model and View.
Answer : B
Explanation
View - This is responsible for displaying all or a portion of the data to the user.
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 of the following components are available using ActionContext map?
A - application - application scoped variables.
B - session - session scoped variables.
Answer : D
Explanation
All of the above options are correct.
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 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 @After annotation?
A - This annotation is a collection of results.
B - This annotation have the name that correspond to the outcome of the execute method.
C - This annotation is used to decorate the execute() method.
D - This annotation marks a action method that needs to be called after the main action method.
Answer : D
Explanation
The @After annotation marks a action method that needs to be called after the main action method and the result was executed. Return value is ignored.
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 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 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 - With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.
Answer : A
Explanation
With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.