Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment:

Update parent page

Description

The following is the step to create a Client-Side validation using webwork. Note the validate attribute is set to true. Note also that not all themes support this feature (client-side validation)

Step 1

Create the jsp page. Note the <ww:head > tag being used, it will setup the css in this case (xhtml theme)

Wiki Markup
{snippet:id=clientValidation|lang=xml|javadoc=false|url=webwork/webapps/showcase/src/webapp/validation/quiz-client.jsp}

Step 2

Create the action class

Wiki Markup
{snippet:id=quizAction|javadoc=false|lang=java|url=webwork/webapps/showcase/src/java/com/opensymphony/webwork/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=webwork/webapps/showcase/src/java/com/opensymphony/webwork/showcase/validation/QuizAction-validation.xml}