Resolving of resourcebundle in org.richfaces.validator.HibernateValidator does not match
the official documentation of Hibernate Validator
------------------------------------------------------------------------------------------------------------------------------------------
Key: RF-8265
URL:
https://jira.jboss.org/jira/browse/RF-8265
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.3.2.GA
Environment: Richfaces 3.3.2.GA
Hibernate Validator 3.1.0.GA
Reporter: Benno Markiewicz
The localisation based on the message attribute of the Hibernate validator annotations
still does not work.
Based on the fixed issue
https://jira.jboss.org/jira/browse/RF-4034, i used a proper
version of richfaces (newer than the fixed version of this issue #4034).
For example (nearly the same as the issue RF-4034):
__________________________________
Annotation from bean:
@Length(max=10,min=4,message="{sizeFailure} !!!")
private String text;
Message from bundle [!]ValidationMessages.properties[!]:
sizeFailure=correct range is {min}-{max}
# Open page with validated input
# Input only one character
Result: validation error "{sizeFailure}"
Expected result: validation error "correct range is 4-10 !!!"
There is an issue regarding the resolving of resourcebundle. This is not implemented as
defined in the offical Hibernate Validator Annotation documentation.
More details:
__________
Richfaces supports localisation via 'ValidatorMessages.properties'
[code]
//org.richfaces.validator.HibernateValidator:line 55
VALIDATOR_MESSAGES="ValidatorMessages"; //-->ValidatorMessages.properties
[/code]
BUT
the Hibernate Validator documentation says "ValidationMessages.properties"
<snip>
(
http://docs.jboss.org/hibernate/stable/validator/reference/en/html_single...)
...This message descriptors get interpolated when a constraint validation fails using the
configured MessageInterpolator. The interpolator will try to resolve any message
parameters, meaning string literals enclosed in braces. In order to resolve these
parameters Hibernate Validator's default MessageInterpolator first recursively
resolves parameters against a custom ResourceBundle called ValidationMessages.properties
at the root of the classpath (It is up to you to create this file). If no further
replacements are possible against the custom bundle the default ResourceBundle under
/org/hibernate/validator/ValidationMessages.properties gets evaluated.
</snip>
Note the difference between 'Validat[ion]Messages.properties' and
'Validat[or]Messages.properties' ('ion' and 'or').
Is Richfaces wrong or the hibernate validator annotation documentation?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira