THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Let's create a Client-Side validation workflow, step by step.
The
validate
attribute is set to true
.
Some themes do not support client-side validation.
Step 1
Create the form.
Wiki Markup |
---|
{snippet:id=clientValidation|lang=xml|javadoc=false|url=action2/apps/showcase/src/main/webapp/validation/quiz-client.jsp} |
This case uses the default xhtml theme, so the
<saf:head >
tag is used to link a style sheet.
Step 2
Create the Action class.
Wiki Markup |
---|
{snippet:id=quizAction|javadoc=false|lang=java|url=action2/apps/showcase/src/main/java/org/apache/struts/action2/showcase/validation/QuizAction.java} |
Step 3
Create the validation.xml
to configure the validators to be used.
Wiki Markup |
---|
{snippet:id=quizValidators|javadoc=false|lang=xml|url=action2/apps/showcase/src/main/java/org/apache/struts/action2/showcase/validation/QuizAction-validation.xml} |