Pregunta

I'd like to create a Java web application on top of Google AppEngine.

What is the best way to develop a REST jSON API?

Do I have to write from scratch a servlet that manages the jSON handling or there is a library or something like the SOAP support for web services?

¿Fue útil?

Solución

No need to write a servlet from scratch, use JAX RS, it is easy and simple http://tugdualgrall.blogspot.com/2010/02/create-and-deploy-jax-rs-rest-service.html

Otros consejos

Try RESTEasy. It has superb docs and there nice examples to be found. It integrates with Jackson which is IMO the best JSON lib for java.

If you use jersey then you should have a look at Genson http://owlike.github.io/genson/. It is a full databinding+streaming java<>json library. And as a bonus with jersey you only need to have genson in your classpath and voila! Everything shall work without any configuration.

the answer here might be what you're looking for. (Gson should be able to both generate and parse JSON)

After some research I think that using jersey is a good

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top