struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruben Carvalho" <>
Subject Multiple validation, one form
Date Wed, 17 Sep 2003 08:14:12 GMT
Sorry for sending this message again but I got no answer with the first one and I'm really
getting crazy with it.
I'm getting a bit confused with the XML validation system. I have one form (DynaValidatorForm),
3 JSPs followed by 3 actions that do nothing. My Form has 3 fields:
name, address and phone, all String
Now, I have 3 different JSPs, test1, test2 and test3.jsp, each of them followed by an Action
like this:
test1.jsp --> Test1Action --> test2.jsp --> Test2Action --> test3.jsp --> Test3Action
All of the JSP have the same code. I want to validate: the first field after submitting the
first page, the second field after submitting the second page and the 3rd field after submitting
the third page. My JSPs look like this:

<html:hidden property="page" value="<MY_PROBLEM>" />
<TABLE border="0">
   <TD><html:text property="name" /></TD>
   <TD><html:text property="address" /></TD>
   <TD><html:text property="phone" /></TD>
   <TD><html:submit property="submit" value="Submit" /></TD>
   <TD><html:reset /></TD>

My validation.xml looks like this:
<form name="testeForm">
 <field property="name" depends="required" page="0">
  <arg0 key="" />
 <field property="address" depends="required" page="1">
  <arg0 key="prompt.address" />
 <field property="phone" depends="required" page="2">
  <arg0 key="" />
Which value should I write in my page property inside the JSPs?
if I put:
<html:hidden property="page" value="0" />
in my test1.jsp I get the error that Name is required. Great. But then I put
<html:hidden property="page" value="1" />
in my test2.jsp and when I submit I don't get any error. And I get the same when I submit
the 3rd JSP.
Does anybody know how to use this page property correctly?
Thanks a lot
RĂºben Carvalho
View raw message