Re: Validation not honouring 'bundle' attribute?

2005-03-18 Thread David Kennedy
Quick update; after a night's sleep I'm starting to think this is a real 
bug and not just a mis-config on my part. Looks like args {0}, {1} etc 
are being looked up in the default resource bundle, even when the error 
messages are being correctly found in the specified bundle.

I'm going to cheat for now and have Ant build one-resource-bundle to 
rule them all, which also makes the JSP pages a bit easier to read as 
all the bundle= tags vanish.

David Kennedy wrote:
Hi folks,
I've just changed our Struts 1.2.6 (ie, with added i18n support) 
application to use several message-resources. This works fine on basic 
pages, but I've noticed a problem with the server-side Validation on 
forms. Validation messages' parameters aren't being found; I see 
validation errors like:
???en_GB.systemsettings.lcdpin.oldpin??? must be a four digit number.

This is very weird as the 'must be a four digit number' is also a custom 
message from the 'systemsettings' message-resource so I know the right 
file is being read.

Here's a snippet of what I have in validation.xml:
  form name=lcdPinForm
field property=oldPin depends=required,mask
  msg name=mask
   key=${fourDigitNumberMessageKey}
   bundle=systemsettings/
  arg position=0
   key=systemsettings.lcdpin.oldpin
   bundle=systemsettings/ !-- THIS IS BROKEN? --
  var
var-namemask/var-name
var-value${fourDigitNumberRegexp}/var-value
  /var
/field
Anyone know how to sort this out or do I have to scrap (ie,  not check 
in) several hours work? :-(

--
David Kennedy
Swan Labs
http://www.swanlabs.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Validation not honouring 'bundle' attribute?

2005-03-18 Thread Niall Pemberton
Although the validator dtd has a bundle attribute its not used in Struts.
Details here

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

The pre-requisite changes to Validator were released in Validator 1.1.4, but
I haven't yet got round to changing Struts.

http://jakarta.apache.org/commons/validator/changes-report.html

Niall

- Original Message - 
From: David Kennedy [EMAIL PROTECTED]
Sent: Friday, March 18, 2005 1:40 AM


 Hi folks,
 I've just changed our Struts 1.2.6 (ie, with added i18n support)
 application to use several message-resources. This works fine on basic
 pages, but I've noticed a problem with the server-side Validation on
 forms. Validation messages' parameters aren't being found; I see
 validation errors like:
  ???en_GB.systemsettings.lcdpin.oldpin??? must be a four digit number.

 This is very weird as the 'must be a four digit number' is also a custom
 message from the 'systemsettings' message-resource so I know the right
 file is being read.



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



Re: Validation not honouring 'bundle' attribute?

2005-03-18 Thread David Kennedy
Thanks for the info Niall, I'll look forward to using the new code later 
in the release cycle.

For now, using Ant to concatenate all resources into one file solves my 
problem (contention for property file in source control) and, bonus, 
doesn't require those writing JSPs to remember to use bundle=

Niall Pemberton wrote:
Although the validator dtd has a bundle attribute its not used in Struts.
Details here
http://issues.apache.org/bugzilla/show_bug.cgi?id=21760
The pre-requisite changes to Validator were released in Validator 1.1.4, but
I haven't yet got round to changing Struts.
http://jakarta.apache.org/commons/validator/changes-report.html
Niall
- Original Message - 
From: David Kennedy [EMAIL PROTECTED]
Sent: Friday, March 18, 2005 1:40 AM


Hi folks,
I've just changed our Struts 1.2.6 (ie, with added i18n support)
application to use several message-resources. This works fine on basic
pages, but I've noticed a problem with the server-side Validation on
forms. Validation messages' parameters aren't being found; I see
validation errors like:
???en_GB.systemsettings.lcdpin.oldpin??? must be a four digit number.
This is very weird as the 'must be a four digit number' is also a custom
message from the 'systemsettings' message-resource so I know the right
file is being read.


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

--
David Kennedy
Swan Labs
http://www.swanlabs.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]