Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-1118

form bean validations are not following the order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.1
    • 1.0.2
    • NetUI
    • None

    Description

      I had a form bean with annotation based validations for each getter method in the form bean

      When the validations are done, it is not following the order of the attributes

      Ex: I had date, serialNumber, sampleValue. When the validations are done, it is always calling the validations on sampleValue followed by date and serial Number

      Is there any way to specify the order of how the validations are being called

      Here is the sampe form

      @Jpf.FormBean(messageBundle="errors")
      public class SampleForm implements Validatable, Serializable {
      String date;
      String serialNumber;
      String sampleValue;

      @Jpf.ValidatableProperty(validateRequired=@Jpf.ValidateRequired(messageKey="000.error", messageArgs={@Jpf.MessageArg(arg="${bundle.dstbundle.date}", position=0)}), validateDate=@Jpf.ValidateDate(messageKey="001.error", messageArgs={@Jpf.MessageArg(arg="${bundle.dstbundle.date}", position=0)}, pattern="mm/dd/yyyy", strict=false))
      public String getDate()

      { return date; }

      public void setDate(String date)

      { this.date = date; }

      @Jpf.ValidatableProperty(validateRequired=@Jpf.ValidateRequired(messageArgs={@Jpf.MessageArg(arg="${bundle.dstbundle.serial}", position=0)}))
      public String getSerialNumber()

      { return serialNumber; }

      public void setSerialNumber(String serialNumber)

      { this.serialNumber = serialNumber; }

      public void validate(ActionMapping mapping, HttpServletRequest request, ActionMessages errors)

      { System.out.println("In the validate method" + errors.size()); }

      @Jpf.ValidatableProperty(validateRequired=@Jpf.ValidateRequired(messageKey="000.error", messageArgs={@Jpf.MessageArg(arg="${bundle.dstbundle.sample}", position=0)}), validateMinLength=@Jpf.ValidateMinLength(messageKey="003.error", messageArgs={@Jpf.MessageArg(arg="${bundle.dstbundle.sample}", position=0)}, chars=4))
      public String getSampleValue()

      { return sampleValue; }

      public void setSampleValue(String sampleValue)

      { this.sampleValue = sampleValue; }

      }

      Attachments

        1. BEEHIVE-1118.patch
          45 kB
          Andrew McCulloch

        Activity

          People

            jzhuo Julie Zhuo
            ssurapan Srinivas Surapaneni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: