seam - RestEasy and JSON - how to avoid quotes around a number? -
i using resteasy marchal entities json. works okay somehow every thing represented string. e.g.
@xmlrootelement(name="testobject") public class testobject { private long value; public long getvalue(){ return value; } }
instead of creating like: {testobject:{value:1234}}
it creates {testobject:{value:"1234"}}
(please note " " around number)
so long value converted string. how can avoid that?
i've asked on jackson forum resteasy using json marchaling said caused going java->xml->json. there doesn't seem resteasy forum , on seam forum no 1 answer question.
does else have same problem?
regards
okay problem resteasy+seam uses jettison default (and not jackson). jettison marchaling via java->xml->json.
the jackson jars aren't included in seam distribution have download resteasy , copy jars mention jackson lib directory. when resteasy finds resteasy-jackson-provider.jar in classpath, jackson used instead of jettison.
one problem had when moving jackson jettison cycling references. jettison annotate method (e.g. @manytoone relationship) @xmltransient
. jackson have annotate @jsonignore
Comments
Post a Comment