Struts2 Online Quiz


Advertisements

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.

Questions and Answers

Answer : D

Explanation

All of the above features are supported in Struts 2.

Answer : A

Explanation

The dispatcher result type is the default type and is used if no other result type is specified.

Answer : C

Explanation

These objects include #application, #session, #request, #attr and #parameters and refer to the corresponding servlet scopes.

Q 4 - What types of validators are available in xml based validation in struts2?

A - date validator

B - double validator

C - email validator

D - All of the above.

Answer : D

Explanation

All of the above validators are available in xml based validation in struts2.

Answer : B

Explanation

The @result annotations have the name that correspond to the outcome of the execute method. They also contain a location as to which view should be served corresponding to return value from execute().

Answer : A

Explanation

This validation annotation checks that a double field has a value within a specified range. If neither min nor max is set, nothing will be done.

Answer : C

Explanation

This annotation sets the Key for type conversion. The Key annotation must be applied at field or method level.

Answer : A

Explanation

This annotation annotation is used for class and application wide conversion rules. The TypeConversion annotation can be applied at property and method level.

Q 9 - Which of the following tag assigns a value to a variable in a specified scope?

A - set tag

B - text tag

C - url tag

D - push tag

Answer : A

Explanation

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.

Q 10 - Struts2 promotes less configuration with the help of using default values for various settings.

A - true

B - false

Answer : A

Explanation

Struts2 promotes less configuration with the help of using default values for various settings. You don't have to configure something unless it deviates from the default settings set by Struts2.

struts_questions_answers.htm
Advertisements