You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dimitris Mouchritsas <di...@eurodyn.com> on 2008/07/10 10:37:46 UTC

Using xdoclet with ValidatorActionForm

Hi all,
I've got a multipage form bean to complete a registration in 3 steps. 
Validator
is not working correctly. Some fields in the first page are validated, 
some are not.
In the 3rd page none of the fields are validated. Now from what I 
understand
I need to extend ValidatorActionForm instead of ValidatorForm. But in 
the xdoclet
path I need to provide a path attribute. (btw I use a patched 1.2.3 
xdoclet to support
struts 1.3.8) If this is the path for the action then I'm in trouble 
because I have 3 seperate
actions for each step. Do I need to combine them in one?

Could you please provide an example of how to use this path attribute?

Thanks
Dimitris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Using xdoclet with ValidatorActionForm

Posted by Dimitris Mouchritsas <di...@eurodyn.com>.
Dimitris Mouchritsas wrote:
> Hi all,
> I've got a multipage form bean to complete a registration in 3 steps. 
> Validator
> is not working correctly. Some fields in the first page are validated, 
> some are not.
> In the 3rd page none of the fields are validated. Now from what I 
> understand
> I need to extend ValidatorActionForm instead of ValidatorForm. But in 
> the xdoclet
> path I need to provide a path attribute. (btw I use a patched 1.2.3 
> xdoclet to support
> struts 1.3.8) If this is the path for the action then I'm in trouble 
> because I have 3 seperate
> actions for each step. Do I need to combine them in one?
>
> Could you please provide an example of how to use this path attribute?
>
> Thanks
> Dimitris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
Finally found the answer, when declaring the page attribute for the 
property in
xdoclet it has to be on the same declaration as in:

     * @struts.validator type="required,mask,maxlength" page="3"

and not as in:
     * @struts.validator type="required,mask,maxlength"
     * @struts.validator page="3"

The latter, even though it produced a valid validation xml it added a 
null as in:

              <field property="name"
                     page="1"
                     depends="required,mask,maxlength,null">

and this messed up the validation.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org