Using real POJOs (without JAXB Annotations) as transfer objects with JAX-RS

December 1st, 2011 · No Comments

Are you annoyed that you have to annotate your POJOs with @XmlRootElement, so they can be used with JAX-RS? If your using Jersey as JAX-RS implementation your lucky: Just add to the <servlet> tag in your web.xml the following snippet: <init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> <param-value>true</param-value> </init-param> After restarting your servlet, your POJOs are marshalled to JSON as [...]

[Read more →]

Topics: · , , , , , , , , ,

Building a JSON web service with Java and Axis2

January 23rd, 2009 · 9 Comments

It is said that in Java usually the easiest things are the hardest. The following is a nice example as it took me some time to figure out how to do it. I wanted to build a simple URL request based web service in Java that returns an JSON object. Yes, you can do that [...]

[Read more →]

Topics: · , , , , , ,

JSON generator for picture data from Flickr

August 28th, 2008 · No Comments

Probably a few other guys did this before, but I had a boring train journey without any internet connection, so I used the bits from my 3D album example and made a JSON generator for Flickr data. What does that mean? Just enter a search term and the program finds matching pictures on Flickr. If [...]

[Read more →]

Topics: · , , , ,