0 Replies Latest reply on Feb 24, 2009 7:45 PM by gjeudy

    Seam remoting and Seam.Remoting.createType()

    gjeudy

      I'm using Seam 2.0.1.GA with Seam remoting.


      I call Seam.Remoting.createType('fqcn') on the client side, fqcn is the full qualified classname of a non-seam POJO. This seems to work great but it has a few quirks and I would like to understand better.


      It seems like only public methods are exported in the stub. In my case I sometimes have properties that are read-only (i.e. the getter is public, the setter is private (still used by hibernate)). I am forced to make the setter public otherwise Seam remoting gets confused and produces a corrupted stub.


      The other quirk I encountered is the accessor method naming versus the field naming.



      private Long specificationId;
      
      public Long getId() {
         return specificationId;
      }
      
      public void setId(Long specificationId) {
        this.specificationId = specificationId;
      }
      


      The stub gets exported normally but when I send the populated javascript stub it fails to unmarshal on the server side and complains that there is no id property set. Changing the field name to:


      private Long id;
      


      fixed the problem.


      ok so stub method names are modeled after methods on the java class but unmarshal operation relies on field names not method names?


      My wishlist would be that read-only properties are supported and a private setter would simply not be stubbed with no side effects. Also I think both marshalling/unmarshalling routine should be consistent and rely solely on method names (not field names)


      Any insights appreciated,