Chapter 10. Processing JSON with Java EE 7

JavaScript Object Notation (JSON) is a lightweight data-interchange format that is commonly used in web services to send and receive data. Currently, Java web applications use different implementation libraries to consume/produce JSON. JSR-353 introduces the Java API for JSON processing for generating, parsing, transforming, and querying JSON. With standardized JSON API implementation, libraries are not required, which makes the applications more portable. The objective of JSR-353 is to provide JSON APIs to produce/consume streaming JSON and to build a Java object model for JSON. Support for Java API for JSON has been added to Java EE 7. In this chapter, we will discuss support for generating and parsing JSON. This chapter has the following sections:

  • Setting the environment
  • Creating a Maven project
  • Creating JSON
  • Parsing JSON
  • Processing JSON in a RESTful web service

Setting up the environment

We need to download and install the following software:

Set the JAVA_HOME, JBOSS_HOME, and MAVEN_HOME environment variables Add %JAVA_HOME%/bin, %MAVEN_HOME%/bin, and %JBOSS_HOME%/bin to the PATH environment variable.

Create a WildFly 8.1.0 runtime as discussed in Chapter 1, Getting Started with EJB 3.x.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.205.232