Implement a resource method using JSON content for a request and response entity.
Configure the JAX-RS application.
Parent
Use JSON content in JAX-RS application requests and responses
RESTful services can consume and produce content using the JSON format.
What to do next
Assemble JAX-RS web applications.
Subtopics
- Use Jackson with plain old Java objects (POJOs)
RESTful services can consume and produce content with the JavaScript Object Notation (JSON) format with the Jackson library.
- Implement a JSON representation of a resource with Jackson and JAXB annotated objects
We can process JavaScript Object Notation (JSON) requests and responses with JAXB annotated objects and Jackson. Jackson is the default JSON processor in WebSphere Application Server. By default, it is included in the JAX-RS runtime environment so we do not need to configure Jackson.
- Implement a resource method using IBM JSON4J
RESTful services can consume and produce content using the JavaScript Object Notation (JSON) format.
- Implement a JSON resource method using JAXB annotated objects with IBM JSON4J
In WebSphere Application Server Version 8, the default JSON processor to handle serializing JAXB annotated classes to JSON is Jackson. To use the IBM JSON4J processor from previous Feature Packs for Web 2.0 instead, add a provider class. Jackson offers more advanced JSON processing.
Related tasks
Use Jackson with plain old Java objects (POJOs) Implement a JSON representation of a resource with Jackson and JAXB annotated objects Implement a resource method using IBM JSON4J Implement a JSON resource method using JAXB annotated objects with IBM JSON4J