This article describes how to get a JSON response from the RESTful web services using jersey implementation.Jersey will use Jackson to convert Java objects to/form JSON.Jackson ObjectMapper can parse JSON from a string, stream or file, and create a Java object or object graph representing the parsed JSON.Jersey will use this API to the marshaling [converting the objects] process.

Add ‘jersey-json.jar‘ to your Maven pom.xml which includes all Jackson and other JSON supporting libraries.


In web.xml add “com.sun.jersey.api.json.POJOMappingFeature” as “init-param”



In the web service class, we need to annotate the method with @Produces(MediaType.APPLICATION_JSON). By doing so we are instructiong the service method that we are expecting the JSON output, thats it jersey will take care rest of the things.


The application will start by hitting the following URL


That’s all for JSON response from the RESTful web services using jersey implementation, Hope you liked it. Keep Learning and Sharing 🙂 !!

One Thought on “JSON Response from the RESTful Web Services”

  • I pay a quick visit each day a few websites and sites to read articles, except this blog offers quality based writing.|

Leave a Reply

Your email address will not be published. Required fields are marked *