I use several resource bundle for my application. The particularity is the
resource bundle is depending of the user?group.

Here, an extract from the struts config file :

<message-resources parameter="com.convergence.ressources.ressources"
null="false" />
        <message-resources key="angers"
parameter="com.convergence.ressources.angers.ressources" null="false" />
        <message-resources key="angersErreurs"
parameter="com.convergence.ressources.angers.erreurs" null="false" />
        <message-resources key="nantes"
parameter="com.convergence.ressources.nantes.ressources" null="false" />
        <message-resources key="nantesErreurs"
parameter="com.convergence.ressources.nantes.erreurs" null="false" />
        <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
                <set-property property="pathnames" 
value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml" />
        </plug-in>

When I submit a form to be validated
There is no problem to post the right message from the right resource
bundle, whether the validation is on the client side (with javascript)or on
the server side.
But these messages to be posted contain some arguments (the names of the
invalidate form fields). 
That?s the problem. 
The validation on the customer side returns arguments from the right
resource bundle (the same which contains the messages to expose) due to the
following tag in the JSP: 

<html:javascript formName="frmSelection" bundle="angersErreurs" />

The validation ont the server side returns arguments from the application
resource bundle (the default resource bundle as declared at the struts
config file :
<message-resources parameter="com.convergence.ressources.ressources"
null="false" />

However the JSP declaration is :
<html:errors bundle="angersErreurs"/>

Because of the dynamic call of the resource bundle(in the jsp examples, i
hide the dynamic bundle call for more readability ), it isn't possible to
specify the resource bundle on the validation.xml file as  field "arg0"
attribute from the field "field".
Extract of the file validation.xml :
<formset> 
        
        <form name="frmSelection">
                        <field property="contexte" depends="required">
                                <arg0 key="frmSelection.contexte" />
                        </field>
                        <field property="selection" depends="required">
                                <arg0 key="frmSelection.selection" />
                        </field>
        </form>

Does exists a solution at this problem of behavior between server and client
or is it a bug from struts?

Regards
Olivier Godineau



-- 
View this message in context: 
http://www.nabble.com/-STRUTS--Resource-bundle-and-form-validation-tf1884718.html#a5152197
Sent from the Struts - User forum at Nabble.com.


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

Reply via email to