1 Reply Latest reply on Jan 24, 2008 2:04 AM by Nicklas Karlsson

    Validation messages are inconsistent

    Gene Campbell Newbie

      Can anyone explain why I can control the message for @Pattern, but the message for @NotNull is ignored.


      If I annotate a field on an @Entity with these annotations

      @NotNull(message="field is null")
      @Pattern("^\W$",message="field not valid")

      and then reference the entity in a JFS/Facelets page like this

      <h:inputText value="#{entity.name}" required="true">

      and then test it, the @NotNull message doesn't doesn't display. I get the default message: {0}: Validation Error: Value is required.

      But, when I test it for the Pattern validation, the @Pattern message DOES display!?

      I haven't tested using a message.properties, and from what I know, we don't have one (though there could be a default one in a jar somewhere that is setup for NotNull but not Pattern.)

      Can anyone clear this up for me?