You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ch...@kattare.com on 2005/07/18 13:11:10 UTC
Calling validator rule direct from code
Hi,
Using Tomcat 5, I have an application which builds a multipage web
form based on data from a database and user input. Id like to be able
to use the validtator to it but cant determine the required fields
until run time. I was wondering how I could use the pre-build
validator rules in this situation. It is possible to explicitly call a
validator rule directly from a servlet. For example suppose I wanted
to call the date validation rule passing it a string containing a date
field and a datePattern of mm/dd/yyyy. Can this be done? If so does
anyone have an example? Or is there another way of solving this?
Thanks,
Charles
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Calling validator rule direct from code
Posted by ch...@kattare.com.
Thanks for this. I think Im going to have to go a bit outside of
standard Struts functionality to do what I need to do but the validator
is part of commons now of course so I can make code level calls that
way.
Quoting Martin Gainty <mg...@hotmail.com>:
> Good Morning Charles
> >From what I can gather there are 4 scenarios to instantiate a form
> and
> handle validation
> http://mail-archives.apache.org/mod_mbox/struts-user/200407.mbox/%
3ccd0k69$78m$1@sea.gmane.org%3e
>
> If you decide to use option D) DynaValidatorForm then
> Take a look at Rick Reumann's site for example of usage
> http://www.reumann.net/struts/lesson3/step4.do
> HTH,
> Martin-
>
> ----- Original Message -----
> From: <ch...@kattare.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, July 18, 2005 7:11 AM
> Subject: Calling validator rule direct from code
>
>
> > Hi,
> >
> > Using Tomcat 5, I have an application which builds a multipage
> web
> > form based on data from a database and user input. I'd like to be
> able
> > to use the validtator to it but can't determine the required
> fields
> > until run time. I was wondering how I could use the pre-build
> > validator rules in this situation. It is possible to explicitly
> call a
> > validator rule directly from a servlet. For example suppose I
> wanted
> > to call the date validation rule passing it a string containing a
> date
> > field and a datePattern of mm/dd/yyyy. Can this be done? If so
> does
> > anyone have an example? Or is there another way of solving this?
> >
> >
> > Thanks,
> >
> > Charles
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Calling validator rule direct from code
Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Charles
>From what I can gather there are 4 scenarios to instantiate a form and
handle validation
http://mail-archives.apache.org/mod_mbox/struts-user/200407.mbox/%3ccd0k69$78m$1@sea.gmane.org%3e
If you decide to use option D) DynaValidatorForm then
Take a look at Rick Reumann's site for example of usage
http://www.reumann.net/struts/lesson3/step4.do
HTH,
Martin-
----- Original Message -----
From: <ch...@kattare.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, July 18, 2005 7:11 AM
Subject: Calling validator rule direct from code
> Hi,
>
> Using Tomcat 5, I have an application which builds a multipage web
> form based on data from a database and user input. I'd like to be able
> to use the validtator to it but can't determine the required fields
> until run time. I was wondering how I could use the pre-build
> validator rules in this situation. It is possible to explicitly call a
> validator rule directly from a servlet. For example suppose I wanted
> to call the date validation rule passing it a string containing a date
> field and a datePattern of mm/dd/yyyy. Can this be done? If so does
> anyone have an example? Or is there another way of solving this?
>
>
> Thanks,
>
> Charles
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org