Tag: json

Here you can see a listing of all the posts tagged with json on this website.

  • Json-lib vs. CGLib Proxies - 1:0

    Posted on Feb. 13, 2008 at 19:27 +0100 Tagged with , , ,

    Sometimes I'm really blind. For the last couple of months I was all the time having some problems with serializing JavaBeans that I get out of Hibernate into JSON and often got an error like this:

    java.lang.NoSuchMethodException: Property 'delegate' has no getter method
    

    I always knew that it had to be something with the whole proxy-layer Hibernate uses for handling for instance lazy referencing, but for some reason I never really actually did anything against it but rewrite the code to build the JSONObjects more or less manually.

    [more ...]

    0 comments

  • Default value handling with Json-lib

    Posted on Feb. 9, 2008 at 13:19 +0100 Tagged with , , ,

    As part of a project I'm working on I'm currently moving tons of data between servers and clients using JSON. Since all components are written in Java I was looking for a simple yet customizable JSON library and eventually ended up using Json-lib which let's you easily serialize a JavaBean into a JSON-string. While looking through the network traffic yesterday, I noticed a small problem, though: When you convert for instance an Integer property of the bean and this Integer is currently a null-pointer, Json-lib will make a 0 out of it. While in most cases probably a good idea, in my particular case it's simply the wrong way of handling the null-reference since 0 has a different semantic in that particular bean.

    [more ...]

    0 comments