Spring:正确显示 HTML 个实体的错误消息

Spring: correctly show error messages with HTML entities

在我的控制器中,我有以下内容:

errors.rejectValue("product", "errors.invalid", new Object[]{
    new DefaultMessageSourceResolvable(new String[]{"label.error.message"})}, "");

在属性文件中,有以下内容:

errors.invalid={0} is invalid.
label.error.message=Product®

在 JSP 页面中,我有:

<form:errors path="product" cssClass="field-error"/>

哪里有输入错误,我现在收到这个消息:

Product&reg; is invalid.

我希望实现的是显示以下内容:

Product® 无效。

谢谢!

直接来自the documentation

htmlEscape - Enable/disable HTML escaping of rendered values.