Multiple choice technology web technology

In a struts 2 implementation, one of the name of the action is SampleAction and corresponding name of the Class is SampleClass. Please identify the correct validation xml name for the Action.

  1. SampleAction-validation.xml

  2. SampleClass-validation.xml

  3. All Of the above

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Struts 2, validation XML files are named after the Action class, not the action name specified in struts.xml. For an action with class SampleClass, the validation file must be named SampleClass-validation.xml. The framework looks for validation files based on the fully qualified class name.