You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suresh Addagalla <su...@wipro.com> on 2002/12/17 10:40:33 UTC

Struts Validator

Hi,

I'm new to Struts and am trying to get a hang of Struts Validator
framework.

I defined the validator-rules.xml, application.properties,
validator.xml. To be able to do server-side validations, is it still
required to have the ActionForm class? If yes, do we need to override
the validate() or what exactly is needed?

Thanks,
Suresh


RE: Struts Validator

Posted by James Turner <tu...@blackbear.com>.
If you want specific information about the Validator, the sample chapter
from Struts Kick Start, on www.strutskickstart.com, deals with DynaForms
and the Validator.

Since people are looking for guidance as to which book(s) to buy, I
thought I'd offer this concise guide:

Struts Kick Start (Motorcycle engine on cover):  Appropriate for people
who watch "Monster Garage" on Discovery, think that Harley Davidson
defines the perfect transportation option, and like leather jackets.

Programming Jakarta Struts (Horsie on cover):  Appropriate for 4H
members, polo riders and men who wear "Stetson" cologne.

The Struts Framework (Bridge on cover): Appropriate for ironworkers,
people who have bought the Brooklyn Bridge, or people who like suspense.

Struts in Action (Jester on stilts on cover):  Appropriate for short
people, members of the Society for Creative Anachronisms and circus
performers.

Mastering Jakarta Struts (Multicolor blob on cover): Appropriate for
people who enjoy Rorsach tests, fans of the Pantone color charts, and
finger-painting enthusiasts.

Struts Fast Track (Does anyone know what it is on this cover):
Appropriate for people who can't make out fuzzy B&W photos on Amazon.

Ok, so it's not Friday.  I just always wonder how many people chose
books based on the cover art.

James

> -----Original Message-----
> From: Iris [mailto:iris@enix.org] 
> Sent: Tuesday, December 17, 2002 5:01 AM
> To: Struts Users Mailing List
> Subject: Re: Struts Validator
> 
> 
> Suresh Addagalla wrote:
> 
> >Thanks Iris.
> >
> >Could you recommend a good book (or online tutorial) for me to learn 
> >Struts? I am going through a lot of material on the web, but 
> more often 
> >I am getting confused than learning something new.
> >  
> >
> Sorry, I don't know the books, I know there is advertisement 
> about books 
> on the struts page
> (http://jakarta.apache.org/struts/) but I didn't read any.
> 
> Iris
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Struts Validator

Posted by Iris <ir...@enix.org>.
Suresh Addagalla wrote:

>Thanks Iris.
>
>Could you recommend a good book (or online tutorial) for me to learn
>Struts? I am going through a lot of material on the web, but more often
>I am getting confused than learning something new.
>  
>
Sorry, I don't know the books, I know there is advertisement about books 
on the struts page
(http://jakarta.apache.org/struts/) but I didn't read any.

Iris


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts Validator

Posted by Suresh Addagalla <su...@wipro.com>.
Thanks Iris.

Could you recommend a good book (or online tutorial) for me to learn
Struts? I am going through a lot of material on the web, but more often
I am getting confused than learning something new.

Suresh

>-----Original Message-----
>From: Iris [mailto:iris@enix.org] 
>Sent: Tuesday, December 17, 2002 3:12 PM
>To: Struts Users Mailing List
>Subject: Re: Struts Validator
>
>
>Suresh Addagalla wrote:
>
>>Hi,
>>
>>I'm new to Struts and am trying to get a hang of Struts Validator
>>framework.
>>
>>I defined the validator-rules.xml, application.properties,
>>validator.xml. To be able to do server-side validations, is it still
>>required to have the ActionForm class? If yes, do we need to override
>>the validate() or what exactly is needed?
>>
>Yes you need an ActionForm to describe your form (get and set).
>But you must no override the validate().
>And to use the validator, your ActionForm must extends ValidatorForm.
>
>Iris
>
>
>
>--
>To unsubscribe, e-mail:   
><ma...@jakarta.apache.org>
>For 
>additional commands, 
>e-mail: <ma...@jakarta.apache.org>
>


Re: Struts Validator

Posted by Iris <ir...@enix.org>.
Suresh Addagalla wrote:

>Hi Iris,
>
>I came across the following excerpt from Struts kickstart:
>
>"After moving all the properties out of the bean and into the DynaForm
>definition in
>struts-config.xml, the only thing left in the bean is the validate
>function. By
>using the Struts Validation framework, which ties into the Commons
>Validator
>package, you can remove this last piece of code and get rid of the form
>bean."
>
>Are we sure that we do need to define the form bean (which extends
>ValidatorForm) if we use Struts Validator?
>  
>
For now I didn't use DynaForm, but I know your form bean can extends 
DynaValidatorForm
instead of ValidatorForm to use validator. But I didn't test it.

Iris



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Struts Validator

Posted by Suresh Addagalla <su...@wipro.com>.
Hi Iris,

I came across the following excerpt from Struts kickstart:

"After moving all the properties out of the bean and into the DynaForm
definition in
struts-config.xml, the only thing left in the bean is the validate
function. By
using the Struts Validation framework, which ties into the Commons
Validator
package, you can remove this last piece of code and get rid of the form
bean."

Are we sure that we do need to define the form bean (which extends
ValidatorForm) if we use Struts Validator?

Thanks,
Suresh


>-----Original Message-----
>From: Iris [mailto:iris@enix.org] 
>Sent: Tuesday, December 17, 2002 3:12 PM
>To: Struts Users Mailing List
>Subject: Re: Struts Validator
>
>
>Suresh Addagalla wrote:
>
>>Hi,
>>
>>I'm new to Struts and am trying to get a hang of Struts Validator
>>framework.
>>
>>I defined the validator-rules.xml, application.properties,
>>validator.xml. To be able to do server-side validations, is it still
>>required to have the ActionForm class? If yes, do we need to override
>>the validate() or what exactly is needed?
>>
>Yes you need an ActionForm to describe your form (get and set).
>But you must no override the validate().
>And to use the validator, your ActionForm must extends ValidatorForm.
>
>Iris


Re: Struts Validator

Posted by Iris <ir...@enix.org>.
Suresh Addagalla wrote:

>Hi,
>
>I'm new to Struts and am trying to get a hang of Struts Validator
>framework.
>
>I defined the validator-rules.xml, application.properties,
>validator.xml. To be able to do server-side validations, is it still
>required to have the ActionForm class? If yes, do we need to override
>the validate() or what exactly is needed?
>
Yes you need an ActionForm to describe your form (get and set).
But you must no override the validate().
And to use the validator, your ActionForm must extends ValidatorForm.

Iris



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>