You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by William W <wi...@hotmail.com> on 2002/06/12 16:14:09 UTC
Validator and DispatchAction
Hi !
I have a UserForm, the fields are : userId and userName.
I have a UserAction that extends DispatchAction. The UserAction have two
methods (insert and update). For the insert method only the userName is
required, and for update method the userId and the userName are required.
How can I can do a dependency validation with the validator.xml ?
Thanks,
William.
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Validator and DispatchAction
Posted by David Winterfeldt <dw...@yahoo.com>.
You would currently have to write your own required
validation method and have it check a variable defined
by a field to see if it should perform the validation
or not. Or define a separate set of validation rules
for each action and use ValidatorActionForm (which
uses the action path to retrieve the validation
rules).
David
--- Rick Reumann <ma...@reumann.net> wrote:
> On Wednesday, June 12, 2002, 10:14:09 AM, William
> wrote:
>
> WW> I have a UserForm, the fields are : userId and
> userName.
> WW> I have a UserAction that extends DispatchAction.
> The UserAction have two
> WW> methods (insert and update). For the insert
> method only the userName is
> WW> required, and for update method the userId and
> the userName are required.
> WW> How can I can do a dependency validation with
> the validator.xml ?
>
> I'm curious about this as well. There was a post
> a few days back
> dealing with the same issue. I think you are
> able to nest
> validation rules for a form but I forgot the
> exact syntax. Maybe
> someone else could shed some light again on how
> to do this.
>
>
> --
>
> Rick
> mailto:maillist@reumann.net
>
> "If you go to a party, and you want to be the
> popular one at the
> party, do this: Wait until no one is looking, then
> kick a burning log
> out of the fireplace onto the carpet. Then jump on
> top of it with your
> body and yell, "Log o' fire! Log o' fire!" I've
> never done this, but I
> think it'd work."
> -Jack Handey
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Validator and DispatchAction
Posted by Rick Reumann <ma...@reumann.net>.
On Wednesday, June 12, 2002, 10:14:09 AM, William wrote:
WW> I have a UserForm, the fields are : userId and userName.
WW> I have a UserAction that extends DispatchAction. The UserAction have two
WW> methods (insert and update). For the insert method only the userName is
WW> required, and for update method the userId and the userName are required.
WW> How can I can do a dependency validation with the validator.xml ?
I'm curious about this as well. There was a post a few days back
dealing with the same issue. I think you are able to nest
validation rules for a form but I forgot the exact syntax. Maybe
someone else could shed some light again on how to do this.
--
Rick
mailto:maillist@reumann.net
"If you go to a party, and you want to be the popular one at the
party, do this: Wait until no one is looking, then kick a burning log
out of the fireplace onto the carpet. Then jump on top of it with your
body and yell, "Log o' fire! Log o' fire!" I've never done this, but I
think it'd work."
-Jack Handey
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>