One form, multiple JSPs, multiple validations

2003-09-15 Thread Ruben Carvalho
Good afternoon helpers,
 
I've started a new application using struts 1.1 and I'm having some problems with some 
new concepts.
 
I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my 
validaton.xml. Right now my application is working fine. Now I want to use different 
validation rules for the same form, accross multiple JSPs. For example:
 
- TestForm is a DynaValidatorForm
  String name
  String address
 
- test1.jsp
  I want to show one text box to fill the name property:
 
(...)
  html:text property=name /
(...)
 
- test2.jsp
  I want to show one text box to fill the address property:
 
(...)
  html:text property=address /
(...)
 
- struts-config.xml
(...)
form-beans
form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm
  form-property name=name type=java.lang.String/
  form-property name=address type=java.lang.String/
/form-bean
/form-beans
(...)
 
- validaton.xml
(...)
formset
form name=logonForm
field property=username depends=required
arg0   key=prompt.username/
/field
field property=address depends=required
arg0   key=prompt.address/
/field
/form
/formset
(...)
 
Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I 
want my app to validate only the name property. Then I forward to test2.jsp, fill 
the address property and now I want to validate only the address property. How can 
I do this? The problem is, what identifies a rule in validation.xml is the form name. 
I could define different names for my form in the struts-config.xml but imagine if I 
had 10 JSPs for each form.
 
Thanks in advance
 
Rben Carvalho
 
 
 
 
 


Re: One form, multiple JSPs, multiple validations

2003-09-15 Thread Sgarlata Matt
Check out

http://jakarta.apache.org/struts/userGuide/dev_validator.html

Under Pluggable Validators there is a section called Multi Page Forms.
I've not done this before, but I think this wizard-like functionality you
are trying to build is built directly into Struts and the Validator.

Matt
- Original Message - 
From: Ruben Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 15, 2003 12:19 PM
Subject: One form, multiple JSPs, multiple validations


 Good afternoon helpers,

 I've started a new application using struts 1.1 and I'm having some
problems with some new concepts.

 I want to use XML form validation (DynaValidatorForm) using
validator-rules.xml and my validaton.xml. Right now my application is
working fine. Now I want to use different validation rules for the same
form, accross multiple JSPs. For example:

 - TestForm is a DynaValidatorForm
   String name
   String address

 - test1.jsp
   I want to show one text box to fill the name property:

 (...)
   html:text property=name /
 (...)

 - test2.jsp
   I want to show one text box to fill the address property:

 (...)
   html:text property=address /
 (...)

 - struts-config.xml
 (...)
 form-beans
 form-bean name=testForm
type=org.apache.struts.validator.DynaValidatorForm
   form-property name=name type=java.lang.String/
   form-property name=address type=java.lang.String/
 /form-bean
 /form-beans
 (...)

 - validaton.xml
 (...)
 formset
 form name=logonForm
 field property=username depends=required
 arg0   key=prompt.username/
 /field
 field property=address depends=required
 arg0   key=prompt.address/
 /field
 /form
 /formset
 (...)

 Now, I run http://localhost/app/test1.jsp and I fill in my name
property. Then I want my app to validate only the name property. Then I
forward to test2.jsp, fill the address property and now I want to validate
only the address property. How can I do this? The problem is, what
identifies a rule in validation.xml is the form name. I could define
different names for my form in the struts-config.xml but imagine if I had 10
JSPs for each form.

 Thanks in advance

 Rben Carvalho








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: One form, multiple JSPs, multiple validations

2003-09-15 Thread K.C. Baltz
What you're looking for is a way to validate a form with multiple 
pages.  Read this, paying special attention to Multi Page Forms  
http://jakarta.apache.org/struts/userGuide/dev_validator.html

K.C.

Ruben Carvalho wrote:

Good afternoon helpers,

I've started a new application using struts 1.1 and I'm having some problems with some new concepts.

I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example:

- TestForm is a DynaValidatorForm
 String name
 String address
- test1.jsp
 I want to show one text box to fill the name property:
(...)
 html:text property=name /
(...)
- test2.jsp
 I want to show one text box to fill the address property:
(...)
 html:text property=address /
(...)
- struts-config.xml
(...)
form-beans
   form-bean name=testForm type=org.apache.struts.validator.DynaValidatorForm
 form-property name=name type=java.lang.String/
 form-property name=address type=java.lang.String/
   /form-bean
/form-beans
(...)
- validaton.xml
(...)
   formset
   form name=logonForm
   field property=username depends=required
   arg0   key=prompt.username/
   /field
   field property=address depends=required
   arg0   key=prompt.address/
   /field
   /form
/formset
(...)
Now, I run http://localhost/app/test1.jsp and I fill in my name property. Then I want my app to validate only the name property. Then I forward to test2.jsp, fill the address property and now I want to validate only the address property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form.

Thanks in advance

Rben Carvalho





 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: One form, multiple JSPs, multiple validations

2003-09-15 Thread Ruben Carvalho
Thank you Matt and K.C. for being so helpful.
 
Sorry everybody for posting such a basic question. I'll try to open my eyes next time 
(and the userguide).
 
Ruben Carvalho
 
Come on now sugar / Bring it on bring it on yeah / Just remember me when / You're good 
to go / Come on now honey / Bring it on bring it on yeah / Just remember me when
We used to be friends / A long time ago / We used to be friends / A long time ago / We 
used to be friends / A long time ago / We used to be friends 
Yeahh
The Dandy Warhols

-Mensagem original- 
De: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Enviada: seg 15-09-2003 20:43 
Para: Struts Users Mailing List 
Cc: 
Assunto: Re: One form, multiple JSPs, multiple validations



Check out

http://jakarta.apache.org/struts/userGuide/dev_validator.html

Under Pluggable Validators there is a section called Multi Page Forms.
I've not done this before, but I think this wizard-like functionality you
are trying to build is built directly into Struts and the Validator.

Matt
- Original Message -
From: Ruben Carvalho [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 15, 2003 12:19 PM
Subject: One form, multiple JSPs, multiple validations


 Good afternoon helpers,

 I've started a new application using struts 1.1 and I'm having some
problems with some new concepts.

 I want to use XML form validation (DynaValidatorForm) using
validator-rules.xml and my validaton.xml. Right now my application is
working fine. Now I want to use different validation rules for the same
form, accross multiple JSPs. For example:

 - TestForm is a DynaValidatorForm
   String name
   String address

 - test1.jsp
   I want to show one text box to fill the name property:

 (...)
   html:text property=name /
 (...)

 - test2.jsp
   I want to show one text box to fill the address property:

 (...)
   html:text property=address /
 (...)

 - struts-config.xml
 (...)
 form-beans
 form-bean name=testForm
type=org.apache.struts.validator.DynaValidatorForm
   form-property name=name type=java.lang.String/
   form-property name=address type=java.lang.String/
 /form-bean
 /form-beans
 (...)

 - validaton.xml
 (...)
 formset
 form name=logonForm
 field property=username depends=required
 arg0   key=prompt.username/
 /field
 field property=address depends=required
 arg0   key=prompt.address/
 /field
 /form
 /formset
 (...)

 Now, I run http://localhost/app/test1.jsp and I fill in my name
property. Then I want my app to validate only the name property. Then I
forward to test2.jsp, fill the address property and now I want to validate
only the address property. How can I do this? The problem is, what
identifies a rule in validation.xml is the form name. I could define
different names for my form in the struts-config.xml but imagine if I had 10
JSPs for each form.

 Thanks in advance

 Rben Carvalho








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]