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-name>mask</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]



Reply via email to