after upgrading from Majorra 2.1.27 to 2.2.5 my Bean-Validation stopped working. Simple example:

<h:form>
    <h:outputLabel for="tf_name" />
    <h:inputText id="tf_name" value="#{test.testEntity.name}" />
    <h:message for="tf_name" />
    <br />
    <h:commandButton value="save" action="#{test.cantTouchThis}"/>
</h:form>

The field "name" on my TestEntity is annotated with @NotNull (and i have set INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL to true in web.xml +org.apache.el.parser.COERCE_TO_ZERO to false for my tomcat).

If i use Majorra 2.1.27 (i use maven btw.) everything works fine. But if i switch to 2.2.5 my Method cantTouchThis() is called, even when i leave the fields empty. I also tried with other validators, none of them seem to work. Validation is skipped completely.

any ideas?

有帮助吗?

解决方案

As tipped by lu4242 this was a bug in Mojarra. The bug emerged in version 2.2.3 and is fixed with 2.2.7 (which at the time of writing this is not officially released).

See JAVASERVERFACES-3183 for more details.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top