I have an object that I\'d like to serve in JSON as a RESTful resource. I have Jersey\'s JSON POJO support turned on like so (in web.xml):
You can use @XmlRootElement if you want to use JAXB annotations (see other answers).
However, if you prefer pure POJO mapping, you must do the following (Unfortunately it isn't written in docs):
com.sun.jersey.config.property.packages init parameter, add org.codehaus.jackson.jaxrs to the list. This will include JSON providers in the scan list of Jersey.