6 Replies Latest reply on Nov 2, 2005 1:53 PM by Patrick Angeles

    How to use validation on non-entity beans?

    ryan dewell Novice

      It seems there is no way to validate non-entity beans. For example, given an Order local interface + OrderBean stateful session bean, OrderBean contains all of the hibernate validation annotations:

      [SomeAction.class]
      ------
      @Valid
      @In(value="Order")
      private Order order;

      @IfInvalid(outcome=Outcome.REDISPLAY)
      public String action(){
      return "success";
      }
      ------

      This basically does nothing at all, when in fact I would expect it to call validate Order. Since Order is an instance of OrderBean, and OrderBean has the validation annotation extensions....

      What am I missing here? I tried doing it manually as well using ClassValidator, but passing OrderBean.class says "proxy not instance of...", etc.

      Any ideas?

      Ryan