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?
All of the above steps are part of the life cycle of a request in Struct2 application.
Q 2 - Which of the following is correct?
Both of the above statements are correct.
Q 3 - Which of the following is correct about FreeMaker result type?
It is used to generate output using predefined templates.
Q 4 - How Struts 2 validation works?
All of the above statements are correct.
Q 5 - Which class of struts is responsible to converts data types from string?
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 @RegexFieldValidator annotation?
This annotation validates a string field using a regular expression.
Q 7 - What is the purpose of @StringLengthFieldValidator annotation?
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 is to be used to include a JSP file in another JSP page?
The include tag will be used to include a JSP file in another JSP page.
Q 9 - Which of the following tag assigns a value to a variable in a specified scope?
The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a complex expression and then simply reference that variable each time rather than the complex expression. The scopes available are application, session, request, page and action.
Struts2 has a great support for multiple view options (JSP, Freemarker, Velocity and XSLT).