add language and cuntry  parameters ,,

<formset language="fr" country="FR"> 

(country may be different from FR )

-----Original Message-----
From: julie gautier [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 3:02 PM
To: Struts Users Mailing List
Subject: RE: Different validations for one form


Done. I always have the same error...

Seyhan Basmaci <[EMAIL PROTECTED]> wrote:you have two formset tag, 

(Note: The FormSet has language, country, and variant attributes that 
correspond with the java.util.Locale class. 
If they are not used, the FormSet will be set to the default locale.)


Put "/commercialplanprint" into first tag, like below



property="prop1"
depends="required">


property="prop2"
depends="required">





property="prop3"
depends="required">





-----Original Message-----
From: julie gautier [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 2:40 PM
To: Struts Users Mailing List
Subject: RE: Different validations for one form


Thanks again for your help.
So, my two jsp are : commercialplanList.jsp and commercialplanPrint.jsp.
I have one form : CommercialPlanForm.class
I have one action class : CommercialPlanAction.class
Here is my struts-config : 

type="com.mypack.CommercialPlanAction"
name="commercialPlanForm"
scope="request"
input="/mainmenu.do">






type="com.mypack.CommercialPlanAction"
name="commercialPlanForm"
scope="request"
input="/mainmenu.do">






In validation.xml, I have : 


property="prop1"
depends="required">


property="prop2"
depends="required">







property="prop3"
depends="required">





See the fields to be validated in commercialplanList.jsp are prop1 and prop2 
and the field to be validated in commercialplanPrint.jsp is prop3.

Now, I wrote in my jsps : 
in commercialplanPrint.jsp : 
and in commercialplanList.jsp : 

And CommercialPlanForm.class extends ValidatorActionForm

Now when I try to access commercialplanPrint.jsp I still have an error that 
says : 

javax.servlet.jsp.JspException: No form found under 'commercialPlanForm' in 
locale 'fr'
at 
org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364)
at 
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335)
at 
org.apache.jsp.commercialplanPrint_jsp._jspx_meth_html_javascript_0(commercialplanPrint_jsp.java:734)
at 
org.apache.jsp.commercialplanPrint_jsp._jspService(commercialplanPrint_jsp.java:210)

What am I doing wrong ?

Thanks !
Seyhan Basmaci wrote:
in your struts config file ,
define two map to same action class,
for example , pathA and PathB 

in validation.xml,, define validation for each path,,
I hope it works :),

formset>






-----Original Message-----
From: julie gautier [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 2:07 PM
To: Struts Users Mailing List
Subject: RE: Different validations for one form


Ok, but I have the same action class too... So how will it know that for one 
jsp, it's a validation and for the other jsp it's the other validation to use...
My two jsp share the same form and the same action class...
Do you have an idea ? 
Thanks for your help.

Seyhan Basmaci wrote:

you can use form based validation or action based validation in struts 1.2 ,

1) to use form based validation, 
form classes must extend ValidatorActionForm or DynaValidatorActionForm classes.
(org.apache.struts.validator.ValidatorActionForm,org.apache.struts.validator.DynaValidatorActionForm)

2) to use action based validation , 
form classes must extend ValidatorForm or DynaValidatorForm classes.
(org.apache.struts.validator.ValidatorForm,org.apache.struts.validator.DynaValidatorForm)
in this case, 
you must give action name instead of form name in your validation.xml file such 
as,

formset>

..........................


you must use second way, take it easy..


-----Original Message-----
From: jgfa92004 [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 1:11 PM
To: struts-user@jakarta.apache.org
Subject: Different validations for one form



Hi everybody,
Here is my problem : I have two jsp that share the same action class 
(and the same form). As they don't contain the same fields, I would 
like to have two different validations : one for each jsp. I use 
Validator and Struts 1.2. How can I do that ?
Thanks in advance.
Julie




---------------------------------------------------------------------
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]



---------------------------------
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail

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



---------------------------------
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail

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



                
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail

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

Reply via email to