1 Reply Latest reply on Sep 8, 2010 4:09 AM by ibenjes

    Problems with RestEasy and JSON

    ibenjes

      Hi,


      I am using RestEasy to marchal entities to JSON. That works okay but somehow every thing is represented as a String.
      e.g.




      @XmlRootElement(name="TestObject")
      public class TestObject {
          private Long value;
          public Long getValue(){
              return value;
          }
      }



      Instead of creating something like:
      {TestObject:{value:1234}}


      It creates
      {TestObject:{value:1234}}


      So the long value is converted into a String. How can I avoid that?


      Regards


      Immo

        • 1. Re: Problems with RestEasy and JSON
          ibenjes

          Anyone?


          I've asked this question on the Jackson mailing list which does the JSON marchaling for RestEASY but they said that this couldn't be a Jackson problem. It is more likely caused by converting the entity first to xml and then to JSON.


          Can anyone help me with this? I can't be the only one who wants to use numbers (Long, Integer) etc. in JSON with RestEASY.


          Cheers


          Immo