Hello Julien,

Thanks for your help.  I will look into the links provided by you.

I've actually prepared a word document (for my Project Leader, so as to present
him with a small example by means of user's phone and email entries, using
validation framework).  I have attached the same and pls. let me know whether
it's o.k.

Please note that I don't use any Stylesheet or ResourceBundle.  Instead of
ResourceBundle, I have, for the time being, hardcoded the following attribute of
validator tag in validator-rules.xml.

msg="Invalid E-Mail Address"

pls. correct me if I have coded wrongly in ActionForm.  I will keep in touch
with you for improving on validator framework step by step.

Thanks for your support,
S.Srikanth(See attached file: Validator_Tutorial_WithStruts.doc)



                                                                                       
                
                      Julien Mercay                                                    
                
                      <[EMAIL PROTECTED]                                          To:  
Oxf Users        
                      om>                       <[EMAIL PROTECTED]>                    
             
                      Sent by:                 cc:                                     
                
                      oxf-users-bounces        Subject:  Re: Urgent Help -- Request 
help on Action     
                      @orbeon.com               class code in Validator Framework.     
                
                                                                                       
                
                                                                                       
                
                      01/21/2004 11:00                                                 
                
                      PM                                                               
                
                      Please respond to                                                
                
                      OXF Users                                                        
                
                                                                                       
                
                                                                                       
                
                                                                                       
                
                                                                                       
                




Hi,

Struts provides two ways to validate user's input.

The first one uses the validate() method on ActionForm. This method
has visibility on the fields of the form and should populate a list of
ActionError should there be any problem with the user's values. See
GuessActionForm.java for an example. Note also how to display these
errors using the "error" input in your stylesheets. See
guess-retry.xsl and the documentation here:

http://www.orbeon.com/oxf/doc/model2x-struts#N101F7

The second way is to use the client-side validation, using
Javascript. Struts helps you with templates (described in
validator-rules.xml and validation.xml). Since validation is done on
the client, you don't need to write Java code to validation, although
it's always a good idea to double check user's input, since client-side
validation could be fooled by a malevolent user.

To use client-side validation, you have to configure the validator
plugin in struts-config.xml, add your rules in validation.xml (a form
element with the required fields), and use the struts:javascript() tag
in your stylesheet. See jsType.xpl and the following URL for examples:

http://www.orbeon.com/oxf/doc/model2x-struts#N10330

Please let me know if I can be of further help.

Regards,
Julien


[EMAIL PROTECTED] wrote:

> Hi,
>
> I am new to Struts Validator Framework (But know the basics of Struts).
>
>>From where can I get a whole example (descriptive or in detail) of validating
a
> user's input etc. using Struts Validator Framework.
>
> I am trying to use validation.xml, validator-rules.xml, struts-config.xml, an
> ActionForm (subclassing ValidatorForm), an Action class (this is where I am
> struck now --- I don't what is to be written there to validate the user's
input)
> and two JSPs (namely first.jsp -- which contains 2 fields viz., Phone and
EMail
> and a submit button ---- On clicking the submit button of first.jsp --
provided
> the validations are successful, the user is redirected to second.jsp).
>
> I am not clear on Action class part of code (validating user's input on Phone
> and Email fields).
>
> Request urgent help.  Any concrete example (Say just validating 2 input fields
> using Validator Framework) would help me start quickly.
>
> Regards,
> S.Srikanth
>
>
>
> _______________________________________________
> oxf-users mailing list
> [EMAIL PROTECTED]
> http://mail.orbeon.com/mailman/listinfo/oxf-users

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users




Attachment: Validator_Tutorial_WithStruts.doc
Description: MS-Word document

_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to