struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Garcia" <>
Subject getText in error messages: resource bundle or bean value?
Date Fri, 19 Oct 2012 12:10:27 GMT
I'm having a problem with getText().
I have the following xml validator:

    <field name="user.confirmPassword">
        <field-validator type="requiredstring">
            <message key="errors.required"/>
        <field-validator type="fieldexpression">
            <param name="expression">
            <message key="errors.confirmPassSame"/>

And the error message is defined in a bundle like this:
errors.confirmPassSame=The ${getText(user.confirmPassword)} field has to
have the same value as the ${getText(user.password)} field.
user.confirmPassword=Confirm Password

I would expect a message like:
The Confirm Password field has to have the same value as the Password field.

However, when the error message is shown, instead of the text from the
resource bundle, what is shown are the actual values of the bean, like this:
The abcd field has to have the same value as the 1234 field.

Is this a bug in getText()?

J. Garcia

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message