commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17543] - Validator does not support non-default resource bundles
Date Fri, 25 Apr 2003 12:38:05 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17543>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17543

Validator  does not support non-default resource bundles

caroline.lauferon@laposte.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From caroline.lauferon@laposte.net  2003-04-25 12:38 -------
Struts resolves the error message key according to the specified bundle, but 
the placeholder's key are resolved by Validator (according to the default 
bundle).
By example: 

-- validation.xml
<validator name="required" msg="errors.required" [....]>
[...]
<field property="userName" depends="required">
   <arg0 key="loginform.user" />
</field>

-- ApplicationResources.properties
errors.required={0} is required
loginform.user=Identifiant

the validator approximately does: 
   errors.add("userName", new ActionError("errors.required","Identifiant"));

loginform.user is resolved by Validator, not by Struts. 
errors.required is resolved by Struts when <html:errors> is processed

If there was a bundle attribute for field, or for arg (maybe better?), we could 
put all errors message like errors.required in a single file, and the 
placeholders in a file specific to the form. 
ex: 
-- validation.xml
<field property="userName" depends="required">
   <arg0 key="loginform.user"  bundle="login"/>
</field>

-- struts-config.xml
<message-resources parameter="resources.ApplicationResourcesErrors" 
key="errors" />
<message-resources parameter="resources.ApplicationResourcesLogin" key="login"/>

-- ApplicationResourcesErrors
errors.required={0} is required

-- ApplicationResourcesLogin
loginform.user=Identifiant

-- loginForm.jsp
<html:errors bundle="errors">

Please excuse my english, I hope I havn't been too confusing.

Caroline Lauferon

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


Mime
View raw message