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.

Questions and Answers

Q 1 - Which of the following is not a part of Struts architecture?

A - MDBs

B - Results / Result types

C - Value Stack / OGNL

D - View technologies

Answer : C

Explanation

MDBs are not a part of Struts architecture.

Answer : A

Explanation

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

Answer : D

Explanation

All of the above options are correct.

Q 4 - What should be the name of xml file used for validation in struts?

A - '[action-class]'-validation.xml

B - validation.xml

C - Both of the above.

D - None of the above.

Answer : A

Explanation

The xml file needs to be named '[action-class]'-validation.xml.

Q 5 - Which class of struts is responsible to convert String to data types?

A - StrutsTypeConverter

B - StringTypeConverter

C - Both of the above.

D - None of the above.

Answer : A

Explanation

StrutsTypeConverter class tells Struts how to convert Environment to a String and vice versa by overriding two methods convertFromString() and convertToString().

Answer : D

Explanation

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 performs basic if-else conditional flow?

A - if and else tags.

B - iterator tags

C - merge tag

D - append tag

Answer : A

Explanation

These tags perform basic condition flow found in every language. 'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else' Tag.

Answer : A

Explanation

org.springframework.web.context.ContextLoaderListener acts as Listener class in struts and spring integration.

Answer : C

Explanation

Both of the above statements are correct.

struts_questions_answers.htm
Advertisements