You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2006/11/29 23:21:49 UTC
Validator without Struts
Hello,
I have the need to do some form validations, but the site in question
is not running Struts, nor WW or any framework. :-(
It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may
be able to work as a stand-alone entity.
I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Validator without Struts
Posted by Niall Pemberton <ni...@gmail.com>.
On 11/29/06, Jim Reynolds <ji...@gmail.com> wrote:
> Hello,
>
> I have the need to do some form validations, but the site in question
> is not running Struts, nor WW or any framework. :-(
>
> It is an older site and I have been commissioned to do some validtion
> within it. I was hoping that the Validator that comes with Struts may
> be able to work as a stand-alone entity.
>
> I am having trouble finding info on the validator that is not linked
> directly with struts. Is this info available, and if so where?
You can use Validator outside Struts, although I haven't actually used
the "framework" side of validator in that way. If it was just
"validation routines" you wanted, rather than the framework side then
Commons Validator has this:
http://tinyurl.com/eahub
If you want to use the framework side then theres info here:
http://tinyurl.com/ymrjy2
http://wiki.apache.org/jakarta-commons/Validator
Theres also an example in the source distro, but you'll have to use
ant to build it yourself
http://wiki.apache.org/jakarta-commons/ValidatorStandalone
Also its worth taking a look at the validator tests (in the source
distro) as they pretty much do "standalone validator".
Niall
> Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: VALIDATION
Posted by Juan Espinosa <pc...@adinet.com.uy>.
I want to know if could use validation in this way, telling
validation to be used only in the medthod registercustomer and the
results for this method
validationOk - result registrationView validationFail - result
registrationEnd
I dont want to use the methods input and success, also in this
action im using the interceptor Modeldriven the get the customer The
customer is created upon a session parameter, if parameter is
personal i create a Personal customer, if the parameter is
enterprise i create a EnterpriseCustomer, both extends Customer class.
This parameter class is loaded by another action SelectCustomer,
that based in a pair of radio buttons load the parameter in the session.
I had all working but i cant do the validation work
Please help me !!!!!
Regards
Juan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: VALIDATION
Posted by Juan Espinosa <pc...@adinet.com.uy>.
In struts 2 if i have validation enabled an i call an action
Customer!registerCustomer.action, te validation get executed, and if its
fails what results uses, and if the validation pass....what it
does...execute the action called maybe...
-----Mensaje original-----
De: Ed Griebel [mailto:edgriebel@gmail.com]
Enviado el: Jueves, 30 de Noviembre de 2006 11:10 a.m.
Para: Struts Users Mailing List
Asunto: Re: VALIDATION
Sorry, I assumed you were using S1, I don't know how for s2.
On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> Im using struts2, doing in this way works in struts2 In struts2 i have
> the object mapping and form....??
>
> -----Mensaje original-----
> De: Ed Griebel [mailto:edgriebel@gmail.com] Enviado el: Jueves, 30 de
> Noviembre de 2006 10:51 a.m.
> Para: Struts Users Mailing List
> Asunto: Re: VALIDATION
>
> The easiest way to do this is to turn off automatic validation in your
> struts-config.xml and manually call validation in your desired methods.
> Something like:
>
> ActionMessages errors = form.validate(mapping, request); if ( errors
> != null && errors.size() > 0 ) {
> LOG.warn("Errors detected!!");
> return mapping.getInputForward();
> }
>
> HTH,
> -ed
>
> On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> > hi to all, im having some problems with validation i have an action
> > named RegisterCustomer with three methods and an object
> >
> > RegisterCustomer implements ModelDriven
> > Customer customer = null;
> >
> > getModel
> > showCustomerRegistrationView
> > registerCustomer
> >
> >
> > I want to know if could use validation in this way, telling
> > validation to be used only in the medthod registercustomer and the
> > results for this method
> >
> > validationOk - result registrationView validationFail - result
> > registrationEnd
> >
> > I dont want to use the methods input and success, also in this
> > action im using the interceptor Modeldriven the get the customer The
> > customer is created upon a session parameter, if parameter is
> > personal i create a Personal customer, if the parameter is
> > enterprise i create a EnterpriseCustomer, both extends Customer class.
> >
> > This parameter class is loaded by another action SelectCustomer,
> > that based in a pair of radio buttons load the parameter in the session.
> >
> > I had all working but i cant do the validation work
> >
> > Please help me !!!!!
> >
> > Regards
> > Juan
> >
> >
> > --------------------------------------------------------------------
> > - 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
>
>
---------------------------------------------------------------------
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: VALIDATION
Posted by Ed Griebel <ed...@gmail.com>.
Sorry, I assumed you were using S1, I don't know how for s2.
On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> Im using struts2, doing in this way works in struts2
> In struts2 i have the object mapping and form....??
>
> -----Mensaje original-----
> De: Ed Griebel [mailto:edgriebel@gmail.com]
> Enviado el: Jueves, 30 de Noviembre de 2006 10:51 a.m.
> Para: Struts Users Mailing List
> Asunto: Re: VALIDATION
>
> The easiest way to do this is to turn off automatic validation in your
> struts-config.xml and manually call validation in your desired methods.
> Something like:
>
> ActionMessages errors = form.validate(mapping, request); if ( errors != null
> && errors.size() > 0 ) {
> LOG.warn("Errors detected!!");
> return mapping.getInputForward();
> }
>
> HTH,
> -ed
>
> On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> > hi to all, im having some problems with validation i have an action
> > named RegisterCustomer with three methods and an object
> >
> > RegisterCustomer implements ModelDriven
> > Customer customer = null;
> >
> > getModel
> > showCustomerRegistrationView
> > registerCustomer
> >
> >
> > I want to know if could use validation in this way, telling validation
> > to be used only in the medthod registercustomer and the results for
> > this method
> >
> > validationOk - result registrationView validationFail - result
> > registrationEnd
> >
> > I dont want to use the methods input and success, also in this action
> > im using the interceptor Modeldriven the get the customer The customer
> > is created upon a session parameter, if parameter is personal i create
> > a Personal customer, if the parameter is enterprise i create a
> > EnterpriseCustomer, both extends Customer class.
> >
> > This parameter class is loaded by another action SelectCustomer, that
> > based in a pair of radio buttons load the parameter in the session.
> >
> > I had all working but i cant do the validation work
> >
> > Please help me !!!!!
> >
> > Regards
> > Juan
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: VALIDATION
Posted by Juan Espinosa <pc...@adinet.com.uy>.
Im using struts2, doing in this way works in struts2
In struts2 i have the object mapping and form....??
-----Mensaje original-----
De: Ed Griebel [mailto:edgriebel@gmail.com]
Enviado el: Jueves, 30 de Noviembre de 2006 10:51 a.m.
Para: Struts Users Mailing List
Asunto: Re: VALIDATION
The easiest way to do this is to turn off automatic validation in your
struts-config.xml and manually call validation in your desired methods.
Something like:
ActionMessages errors = form.validate(mapping, request); if ( errors != null
&& errors.size() > 0 ) {
LOG.warn("Errors detected!!");
return mapping.getInputForward();
}
HTH,
-ed
On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> hi to all, im having some problems with validation i have an action
> named RegisterCustomer with three methods and an object
>
> RegisterCustomer implements ModelDriven
> Customer customer = null;
>
> getModel
> showCustomerRegistrationView
> registerCustomer
>
>
> I want to know if could use validation in this way, telling validation
> to be used only in the medthod registercustomer and the results for
> this method
>
> validationOk - result registrationView validationFail - result
> registrationEnd
>
> I dont want to use the methods input and success, also in this action
> im using the interceptor Modeldriven the get the customer The customer
> is created upon a session parameter, if parameter is personal i create
> a Personal customer, if the parameter is enterprise i create a
> EnterpriseCustomer, both extends Customer class.
>
> This parameter class is loaded by another action SelectCustomer, that
> based in a pair of radio buttons load the parameter in the session.
>
> I had all working but i cant do the validation work
>
> Please help me !!!!!
>
> Regards
> Juan
>
>
> ---------------------------------------------------------------------
> 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: VALIDATION
Posted by Ed Griebel <ed...@gmail.com>.
The easiest way to do this is to turn off automatic validation in your
struts-config.xml and manually call validation in your desired
methods. Something like:
ActionMessages errors = form.validate(mapping, request);
if ( errors != null && errors.size() > 0 ) {
LOG.warn("Errors detected!!");
return mapping.getInputForward();
}
HTH,
-ed
On 11/30/06, Juan Espinosa <pc...@adinet.com.uy> wrote:
> hi to all, im having some problems with validation i have an action named
> RegisterCustomer with three methods and an object
>
> RegisterCustomer implements ModelDriven
> Customer customer = null;
>
> getModel
> showCustomerRegistrationView
> registerCustomer
>
>
> I want to know if could use validation in this way, telling validation to be
> used only in the medthod registercustomer and the results for this method
>
> validationOk - result registrationView
> validationFail - result registrationEnd
>
> I dont want to use the methods input and success, also in this action im
> using the interceptor Modeldriven the get the customer The customer is
> created upon a session parameter, if parameter is personal i create a
> Personal customer, if the parameter is enterprise i create a
> EnterpriseCustomer, both extends Customer class.
>
> This parameter class is loaded by another action SelectCustomer, that based
> in a pair of radio buttons load the parameter in the session.
>
> I had all working but i cant do the validation work
>
> Please help me !!!!!
>
> Regards
> Juan
>
>
> ---------------------------------------------------------------------
> 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
VALIDATION
Posted by Juan Espinosa <pc...@adinet.com.uy>.
hi to all, im having some problems with validation i have an action named
RegisterCustomer with three methods and an object
RegisterCustomer implements ModelDriven
Customer customer = null;
getModel
showCustomerRegistrationView
registerCustomer
I want to know if could use validation in this way, telling validation to be
used only in the medthod registercustomer and the results for this method
validationOk - result registrationView
validationFail - result registrationEnd
I dont want to use the methods input and success, also in this action im
using the interceptor Modeldriven the get the customer The customer is
created upon a session parameter, if parameter is personal i create a
Personal customer, if the parameter is enterprise i create a
EnterpriseCustomer, both extends Customer class.
This parameter class is loaded by another action SelectCustomer, that based
in a pair of radio buttons load the parameter in the session.
I had all working but i cant do the validation work
Please help me !!!!!
Regards
Juan
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Validator without Struts
Posted by "Saeed, Rada" <ra...@eds.com>.
U can use the nn-validation.js, have a look :
http://www.siteexperts.com/tips/functions/ts21/page10.asp
-----Original Message-----
From: Jim Reynolds [mailto:jim.jreynold@gmail.com]
Sent: Thursday, November 30, 2006 12:22 AM
To: user@struts.apache.org
Subject: Validator without Struts
Hello,
I have the need to do some form validations, but the site in question is
not running Struts, nor WW or any framework. :-(
It is an older site and I have been commissioned to do some validtion
within it. I was hoping that the Validator that comes with Struts may be
able to work as a stand-alone entity.
I am having trouble finding info on the validator that is not linked
directly with struts. Is this info available, and if so where?
Thanks
---------------------------------------------------------------------
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