You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2026/10/05 14:33:23 UTC

(struts-site) branch docs/bean-validation-message-keys created (now 720d2d4d96)

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch docs/bean-validation-message-keys
in repository https://gitbox.apache.org/repos/asf/struts-site.git


      at 720d2d4d96 docs: describe how the Bean Validation plugin resolves constraint messages

This branch includes the following new commits:

     new 720d2d4d96 docs: describe how the Bean Validation plugin resolves constraint messages

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(struts-site) 01/01: docs: describe how the Bean Validation plugin resolves constraint messages

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch docs/bean-validation-message-keys
in repository https://gitbox.apache.org/repos/asf/struts-site.git

commit 720d2d4d969a7308a1fd770b3bcf34da654b1213
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Mon Oct 5 16:33:16 2026 +0200

    docs: describe how the Bean Validation plugin resolves constraint messages
    
    Co-Authored-By: Claude Opus 5.5 <no...@anthropic.com>
---
 source/plugins/bean-validation/index.md | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/source/plugins/bean-validation/index.md b/source/plugins/bean-validation/index.md
index 3a33f00be7..872687a9b7 100644
--- a/source/plugins/bean-validation/index.md
+++ b/source/plugins/bean-validation/index.md
@@ -95,8 +95,17 @@ in your stack (or by removing them from your stack).
 
 Here is an example Action that makes use of bean validation. Note that some of the validation annotations are taken
 from `javax` package (which is defined in the JSR) while others are taken from the validaton provider (in this
-case: `hibernate`). You can specifiy own text keys in the `message` attribute of the annotations. If you do that the
-whole struts i18n mechanism kicks in to resolve those text keys.
+case: `hibernate`). You can specify your own text keys in the `message` attribute of the annotations. The plugin
+looks up the `message` value as a Struts text key, and when the key is found the whole Struts i18n mechanism kicks in
+to resolve it. When no key matches, or `message` keeps the provider's default (like
+`{jakarta.validation.constraints.NotNull.message}`), the message produced by the validation provider is shown
+literally, exactly as the provider interpolated it.
+
+Since Struts 7.5.0 and 6.13.0 the plugin looks up the `message` value itself and shows a provider-produced message
+literally ([WW-5757](https://issues.apache.org/jira/browse/WW-5757)). Earlier versions used the message after the
+provider had interpolated it as the text key, and processed it again as a Struts message when no key matched.
+`struts.beanValidation.convertMessageToUtf` now applies only to messages resolved from Struts bundles.
+{:.alert .alert-info}
 
 **com.example.actions.BeanValidationAction**