You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Wolfgang Gehner <ne...@infonoia.com> on 2005/10/03 09:32:27 UTC

Struts 1.3 issue with commons-validator-1.2.0 dev

While bringing an app to a recent build (0909) of struts 1.3 and 
commons-validator-1.2.0, I notice the following related to ValidatorPlugIn:

When using multiple validation files, as in:

<plug-in clasname="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
    
value="/WEB-INF/lib/validator-rules.xml,/WEB-INF/moduleA/validationA.xml,/WEB-INF/moduleB/validationB.xml"/>
</plug-in>

I get in the tomcat console:

"WARN Overriding FormSet definition. Duplicate for locale: fr"

Result is that validation rules on moduleA are not working.

I suspect  the message is because both validationA.xml and 
validationB.xml have a <formset language="fr">

We used to be able to have one validationX.xml per module without 
problems. (Having the bundle attribute since struts 1.2x made that even 
better, so there could be one resource-file per module).

 I see that now commons-validator 1.2 seems to change this. I fear that 
without a fix I would have to go back to validations for 400 screens in 
one single validationABCDEF...xml.

It looks like commons-validation 1.2 implementation builds a formset key 
based on language, country and variant, but doesn't seem to merge 
formsets any more.

If my analysis is correct, my suggestion would be
- to either have commons-validator continue to merge formsets for  
backward compatibility, and/or,
- add a namespace or id parameter as in <formset id="moduleA" 
language="fr">, if necessary to keep the "physical map" feature.

Using existing variant as namespace as in language="fr" country="ch" 
variant="moduleA" would be an ugly hack, because I would have to specify 
the locale as this for every jsp so that validation would still work.

Kind regards,

Wolfgang Gehner


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Joe Germuska <Jo...@Germuska.com>.
At 10:40 AM -0700 10/3/05, Don Brown wrote:
>Good, I take it that you in fact meant 1.2.x and not 1.1.x :)

Yes, I suppose I was a bit terse!  I was just saying that Niall made 
the case, as far as I'm concerned.  I haven't been following enough 
to know and appreciated the rundown.

>Commons Validator 1.2.0 is waiting on a beta release vote now, and 
>until this current issue, it had no open bugs against it.  In fact, 
>I'd say it is much closer to a final release than 1.3.0 is :)

alas I'm deep into the next app development project, so I don't have 
a lot of spare cycles for helping to push the release out.

joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Don Brown <mr...@twdata.org>.
Good, I take it that you in fact meant 1.2.x and not 1.1.x :)  Commons Validator 
1.2.0 is waiting on a beta release vote now, and until this current issue, it 
had no open bugs against it.  In fact, I'd say it is much closer to a final 
release than 1.3.0 is :)

Don

Joe Germuska wrote:
>> As well as the changes already mentioned, there are a number of bug
>> fixes and the "inheritance feature" which IMO would be good to have in
>> Struts 1.3.0.
> 
> 
> I'm convinced that it makes more sense to stick with c-v 1.2.x for now.
> 
> Joe
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Joe Germuska <Jo...@Germuska.com>.
>As well as the changes already mentioned, there are a number of bug
>fixes and the "inheritance feature" which IMO would be good to have in
>Struts 1.3.0.

I'm convinced that it makes more sense to stick with c-v 1.2.x for now.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I believe the main motivation for moving to Validator 1.2.0 was that it
includes a fix for Bug 35127

http://issues.apache.org/bugzilla/show_bug.cgi?id=35127

Having said that, there are at least two changes in Struts 1.3.0 which
depend on Validator 1.2.0 which would need to be "backed out" in order to
revert to Validator 1.1.4

http://svn.apache.org/viewcvs.cgi?rev=289694&view=rev
http://svn.apache.org/viewcvs.cgi?rev=279861&view=rev

Don has done quite a bit of work in the past 3/4 months to get Validator
into a state where its ready for a beta release (which IMO it was until this
issue came up) and I've been chipping in with a some changes towards that
goal as well:

http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg67372.html
http://jakarta.apache.org/commons/validator/changelog-report.html

I think we should stick with Validator 1.2.0 and sort out this isssue. I
haven't yet had a look in detail at the changes that caused it, but I will
and it would also be good to hear Don's point of view.

Up to this point Don has been the main driving force for a Validator 1.2.0
release, but if he isn't able to complete it then I can make the time to
step in. As well as the changes already mentioned, there are a number of bug
fixes and the "inheritance feature" which IMO would be good to have in
Struts 1.3.0.

Niall

----- Original Message ----- 
From: "Joe Germuska" <Jo...@Germuska.com>
Sent: Monday, October 03, 2005 2:42 PM


> At 3:11 PM +0200 10/3/05, Wolfgang Gehner wrote:
> >So you noticed the same problem.
> >
> >Joe, does this work for you?
> >Your post at
> >http://www.mail-archive.com/dev%40struts.apache.org/msg12064.html
> >seems to imply this. What do you do differently?
> >
> >Or should Struts 1.3 go back to validator 1.1.4 rather than depend on 1.2
DEV?
>
> I'm still not working with a bleeding-edge nightly build; it looks
> like I haven't updated since mid-August.
>
> I have to admit that I had some trepidation when I saw the mention of
> move to commons-validator 1.2-DEV when we are theoretically trying to
> close in on a Struts 1.3 release.  Are people actively working on a
> commons-validator release?  If not, reverting may make sense -- what
> Struts features actually depend on commons-validator 1.2 besides the
> build?
>
> Joe
>
> -- 
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
> "Narrow minds are weapons made for mass destruction"  -The Ex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Joe Germuska <Jo...@Germuska.com>.
At 3:11 PM +0200 10/3/05, Wolfgang Gehner wrote:
>So you noticed the same problem.
>
>Joe, does this work for you?
>Your post at
>http://www.mail-archive.com/dev%40struts.apache.org/msg12064.html
>seems to imply this. What do you do differently?
>
>Or should Struts 1.3 go back to validator 1.1.4 rather than depend on 1.2 DEV?

I'm still not working with a bleeding-edge nightly build; it looks 
like I haven't updated since mid-August.

I have to admit that I had some trepidation when I saw the mention of 
move to commons-validator 1.2-DEV when we are theoretically trying to 
close in on a Struts 1.3 release.  Are people actively working on a 
commons-validator release?  If not, reverting may make sense -- what 
Struts features actually depend on commons-validator 1.2 besides the 
build?

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Wolfgang Gehner <ne...@infonoia.com>.
So you noticed the same problem.

Joe, does this work for you?
Your post at
http://www.mail-archive.com/dev%40struts.apache.org/msg12064.html
seems to imply this. What do you do differently?

Or should Struts 1.3 go back to validator 1.1.4 rather than depend on 
1.2 DEV?

Wolfgang

Niall Pemberton wrote:

>I hadn't realized this was a recent change :-(
>
>  http://www.mail-archive.com/dev%40struts.apache.org/msg12033.html
>
>...but you prompted me to compare Validator 1.1.4 with the current version,
>and this is caused by this change to ValidatorResources (revision 264683) a
>few weeks ago:
>
>   http://svn.apache.org/viewcvs.cgi?rev=264683&view=rev
>
>The issue is in Commons Validator (rather than Struts) - probably best if
>you open a bugzilla ticket against Commons Validator for this.
>
>Niall
>
>----- Original Message ----- 
>From: "Wolfgang Gehner" <ne...@infonoia.com>
>Sent: Monday, October 03, 2005 8:32 AM
>
>
>  
>
>>While bringing an app to a recent build (0909) of struts 1.3 and
>>commons-validator-1.2.0, I notice the following related to
>>    
>>
>ValidatorPlugIn:
>  
>
>>When using multiple validation files, as in:
>>
>><plug-in clasname="org.apache.struts.validator.ValidatorPlugIn">
>><set-property property="pathnames"
>>
>>
>>    
>>
>value="/WEB-INF/lib/validator-rules.xml,/WEB-INF/moduleA/validationA.xml,/WE
>B-INF/moduleB/validationB.xml"/>
>  
>
>></plug-in>
>>
>>I get in the tomcat console:
>>
>>"WARN Overriding FormSet definition. Duplicate for locale: fr"
>>
>>Result is that validation rules on moduleA are not working.
>>
>>I suspect  the message is because both validationA.xml and
>>validationB.xml have a <formset language="fr">
>>
>>We used to be able to have one validationX.xml per module without
>>problems. (Having the bundle attribute since struts 1.2x made that even
>>better, so there could be one resource-file per module).
>>
>> I see that now commons-validator 1.2 seems to change this. I fear that
>>without a fix I would have to go back to validations for 400 screens in
>>one single validationABCDEF...xml.
>>
>>It looks like commons-validation 1.2 implementation builds a formset key
>>based on language, country and variant, but doesn't seem to merge
>>formsets any more.
>>
>>If my analysis is correct, my suggestion would be
>>- to either have commons-validator continue to merge formsets for
>>backward compatibility, and/or,
>>- add a namespace or id parameter as in <formset id="moduleA"
>>language="fr">, if necessary to keep the "physical map" feature.
>>
>>Using existing variant as namespace as in language="fr" country="ch"
>>variant="moduleA" would be an ugly hack, because I would have to specify
>>the locale as this for every jsp so that validation would still work.
>>
>>Kind regards,
>>
>>Wolfgang Gehner
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>For additional commands, e-mail: dev-help@struts.apache.org
>
>
>  
>


Re: Struts 1.3 issue with commons-validator-1.2.0 dev

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
I hadn't realized this was a recent change :-(

  http://www.mail-archive.com/dev%40struts.apache.org/msg12033.html

...but you prompted me to compare Validator 1.1.4 with the current version,
and this is caused by this change to ValidatorResources (revision 264683) a
few weeks ago:

   http://svn.apache.org/viewcvs.cgi?rev=264683&view=rev

The issue is in Commons Validator (rather than Struts) - probably best if
you open a bugzilla ticket against Commons Validator for this.

Niall

----- Original Message ----- 
From: "Wolfgang Gehner" <ne...@infonoia.com>
Sent: Monday, October 03, 2005 8:32 AM


> While bringing an app to a recent build (0909) of struts 1.3 and
> commons-validator-1.2.0, I notice the following related to
ValidatorPlugIn:
>
> When using multiple validation files, as in:
>
> <plug-in clasname="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
>
>
value="/WEB-INF/lib/validator-rules.xml,/WEB-INF/moduleA/validationA.xml,/WE
B-INF/moduleB/validationB.xml"/>
> </plug-in>
>
> I get in the tomcat console:
>
> "WARN Overriding FormSet definition. Duplicate for locale: fr"
>
> Result is that validation rules on moduleA are not working.
>
> I suspect  the message is because both validationA.xml and
> validationB.xml have a <formset language="fr">
>
> We used to be able to have one validationX.xml per module without
> problems. (Having the bundle attribute since struts 1.2x made that even
> better, so there could be one resource-file per module).
>
>  I see that now commons-validator 1.2 seems to change this. I fear that
> without a fix I would have to go back to validations for 400 screens in
> one single validationABCDEF...xml.
>
> It looks like commons-validation 1.2 implementation builds a formset key
> based on language, country and variant, but doesn't seem to merge
> formsets any more.
>
> If my analysis is correct, my suggestion would be
> - to either have commons-validator continue to merge formsets for
> backward compatibility, and/or,
> - add a namespace or id parameter as in <formset id="moduleA"
> language="fr">, if necessary to keep the "physical map" feature.
>
> Using existing variant as namespace as in language="fr" country="ch"
> variant="moduleA" would be an ugly hack, because I would have to specify
> the locale as this for every jsp so that validation would still work.
>
> Kind regards,
>
> Wolfgang Gehner



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Locale Specific Validator Formsets [WAS Struts 1.3 issue with commons-validator-1.2.0 dev]

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Wolfgang,

You're obviously using "locale specific" formsets in your appilication. I
just thought I would highlight one of the changes in Struts 1.3.0 /
Validator 1.2.0 that might be of interest to you.

You can now specify a resource key/bundle for Validator <var> values - for
example if you want different locales to validate a date using locale
specific formats, then you can put the format to use in a resource bundle
and specify the key in your validation.xml:

   <field property="orderdate" depends="date">
      <var resource="true" bundle="validation">
         <var-name>datePattern</var-name>
         <var-value>orderdate.pattern</var-value>
      </var>
   <field>


I believe that in alot of circumstance this will completely remove the need
to have locale specific formsets - simplifying peoples' validation.xml by
reducing the duplication of rules for different locales.

     http://svn.apache.org/viewcvs.cgi?rev=289694&view=rev


The struts-examples webapp has been updated in Struts 1.3.0 to include an
example of this - see the "I18N Variables" section on the "Validator
Examples" page.

Niall

----- Original Message ----- 
From: "Wolfgang Gehner" <ne...@infonoia.com>
Sent: Monday, October 03, 2005 8:32 AM


> While bringing an app to a recent build (0909) of struts 1.3 and
> commons-validator-1.2.0, I notice the following related to
ValidatorPlugIn:
>
> When using multiple validation files, as in:
>
> <plug-in clasname="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
>
>
value="/WEB-INF/lib/validator-rules.xml,/WEB-INF/moduleA/validationA.xml,/WE
B-INF/moduleB/validationB.xml"/>
> </plug-in>
>
> I get in the tomcat console:
>
> "WARN Overriding FormSet definition. Duplicate for locale: fr"
>
> Result is that validation rules on moduleA are not working.
>
> I suspect  the message is because both validationA.xml and
> validationB.xml have a <formset language="fr">
>
> We used to be able to have one validationX.xml per module without
> problems. (Having the bundle attribute since struts 1.2x made that even
> better, so there could be one resource-file per module).
>
>  I see that now commons-validator 1.2 seems to change this. I fear that
> without a fix I would have to go back to validations for 400 screens in
> one single validationABCDEF...xml.
>
> It looks like commons-validation 1.2 implementation builds a formset key
> based on language, country and variant, but doesn't seem to merge
> formsets any more.
>
> If my analysis is correct, my suggestion would be
> - to either have commons-validator continue to merge formsets for
> backward compatibility, and/or,
> - add a namespace or id parameter as in <formset id="moduleA"
> language="fr">, if necessary to keep the "physical map" feature.
>
> Using existing variant as namespace as in language="fr" country="ch"
> variant="moduleA" would be an ugly hack, because I would have to specify
> the locale as this for every jsp so that validation would still work.
>
> Kind regards,
>
> Wolfgang Gehner



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org