2 Replies Latest reply on May 3, 2010 8:42 AM by Jochen Hebbrecht

    Separating model and seam

    Jochen Hebbrecht Newbie

      Hi,


      I'm currently throwing a validation message to my view layer using the Hibernate Validation framework (validation is made on my model/object using annotations):


           @NotEmpty
           @Pattern(regex = "[0-9_\\-/\\. ]{1,}", message = "{biller.details.field.incorrect.characters}")
           private String dummyString;



      The messages is surrounded with { } so Seam will localize the key with his i18n resource bundle.


      This works fine, but ... if you think a step further, and look more to the architecture, you can see you are making your model dependent of Seam. Imagine your model should be picked up in a Spring application, the messages with { } will not be working any longer ...


      So, how can we use the Seam resource bundle from the Hibernate Validation framework without being dependent on Seam?