You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sa...@pg.com on 2003/06/17 18:51:17 UTC

message resource in validation.xml [part2]

I am searching for a way to separate my error message resource bundle from my application message resource bundle.
Although, the post below answers part of my questions there is still one problem:

If i use validator to generate javascript validation, the message printed in the window dont know nothing about any message resource bundles...
(i cant use <html:javascript formName="myform" bundle="ERROR_BUNDLE" />).

Open to suggestions...

Pedro Salgado

- - - - - - - - - - -

Hi Mahesh,

You can certainly specify a message in another bundle:

Here's the validation.xml for my field, "longField"


            <field property="longField"   depends="long"   >
                <arg0 key="validateForm.longField.errorname"/>
            </field>

Here's where I put longField on a form, along with display of an error message
from a validation-specific message resource file (note bundle= ):

<html:text property="longField" />
<html:errors property="longField" bundle="VALIDATOR_BUNDLE"/>

Here's where the separate bundle is incorporated in my struts-config.xml file:

<message-resources parameter="torch.webapp.panthers.ValidatorResources"
null="false"
key="VALIDATOR_BUNDLE">
</message-resources>

and the error message from ValidatorResources.properties looked like:

errors.long={0} must be a long.

HTH,

-jeff


On Monday, March 31, 2003, at 04:35 PM, Bhagia, Mahesh wrote:



Hi,


Is there any way to change / specify message resource bundle in
validation.xml / validation-rules.xml.
validation_1_1.dtd  doesn't seem to define that ... (i guess it assumes
<arg0 key="registrationForm.firstname.displayname"/>  key from default
message resource)

or is there a way to change message resource in Plug-in class (may be extend
it)

Thanks

Mahesh Bhagia




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



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