- 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?
Answer : D
Explanation
All of the above features are supported in Struts 2.
Q 2 - Which of the following is true about Interceptors?
A - Interceptors are conceptually the same as servlet filters or the JDKs Proxy class.
Answer : C
Explanation
Both of the above statements are correct.
Q 3 - Which of the following is correct about FreeMaker result type?
B - It is used to generate output using predefined templates.
Answer : B
Explanation
It is used to generate output using predefined templates.
Q 4 - Can you override the default error message that can come during file uploading process?
Answer : A
Explanation
You can override the text of these messages in WebContent/WEB-INF/classes/messages.properties resource files.
Q 5 - Which class of struts is responsible to convert String to data types?
Answer : A
Explanation
StrutsTypeConverter class tells Struts how to convert Environment to a String and vice versa by overriding two methods convertFromString() and convertToString().
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 @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 enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace?
Answer : B
Explanation
The action tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action.
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.
Q 10 - The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.
Answer : B
Explanation
The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.