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 model 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 : A
Explanation
Model - The lowest level of the pattern which is responsible for maintaining data.
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 - What types of validators are available in xml based validation in struts2?
Answer : D
Explanation
All of the above validators are available in xml based validation in struts2.
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 @IntRangeFieldValidator annotation?
A - This annotation checks that a double field has a value within a specified range.
B - This annotation checks that a field is a valid e-mail address if it contains a non-empty String.
C - This annotation validates a supplied regular expression.
D - This annotation checks that a numeric field has a value within a specified range.
Answer : D
Explanation
This validation annotation checks that a numeric field has a value within a specified range. If neither min nor max is set, nothing will be done.
Q 7 - What is the purpose of @UrlValidator annotation?
A - This annotation checks that a field is a valid URL.
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 : A
Explanation
This validator checks that a field is a valid URL.
Q 8 - Which of the following tag is to be used to include a JSP file in another JSP page?
Answer : C
Explanation
The include tag will be used to include a JSP file in another JSP page.
Q 9 - Which of the following tag can be used to parameterize other tags?
Answer : B
Explanation
The param tag can be used to parameterize other tags.
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.