4 Replies Latest reply on May 28, 2009 8:54 PM by willie slepecki

    validators not working

    willie slepecki Newbie

      im trying to get form validation working.  for some reason the required field validation is working but the regex pattern validation isn't working.  here is my entity bean

      @Pattern(regex = SSN)
           public void setSsn(String ssn)
                this.ssn = ssn;

      the constant that holds the pattern

      public static String SSN = "\\b(?!000)(?!666)(?:[0-6]\\d{2}|7(?:[0-356]\\d|7[012]))[- ](?!00)\\d{2}[- ](?!0000)\\d{4}\\b";

      and lastly my xhtml

      <s:decorate id="in_ssnDecoration" template="/layout/edit.xhtml">
                               <ui:define name="label">#{messages.show_ssn}</ui:define>
                               <h:inputText id="in_ssn" value="#{ecaTO.ssn}" required="true">
                                    <a:support event="onblur" reRender="in_ssnDecoration" bypassUpdates="false" />

      now one difference with my code is my entity bean is not attached to a database.  its just a transfer object container that eventually gets converted into xml and sent to a web service.  why isn't my pattern validator working?