struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Kyser <ktra...@comcast.net>
Subject Re: message resource in validation.xml
Date Tue, 01 Apr 2003 00:27:04 GMT
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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Mime
View raw message