Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added step 4.

...

Wiki Markup
{snippet:id=quizValidators|javadoc=false|lang=xml|url=struts2/apps/showcase/src/main/resources/org/apache/struts2/showcase/validation/QuizAction-validation.xml}

Step 4

Make sure there is a result for "input" listed in the struts.xml for when the validation fails:

Code Block
xml
xml

<action name="HelloWorld" class="tutorial.HelloWorld">
<result name="success">/tutorial/createconfirm.jsp</result>
<result name="error">/tutorial/error.jsp</result>
<result name="input">/tutorial/create.jsp</result>
</action>

If you don't have this, you'll get a: "No result defined for action xxx.xxx.tutorial.HellowWorld and result input" error