Convert JSON String To Java Object, Jettison Example

On this Jettison Example explains about converting a JSON string to java object Using Jettison JSON library

Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nearly transparent enablement of JSON based web services in services frameworks like CXF or XML serialization frameworks like XStream

Reference ->

Here I am showing an example about How to convert a JSON string into Java Object using Jettison library.

Required Libraries

You need to download

  1. Jettison

Following jar must be in classpath

  1. jettison-1.3.3.jar

Project structure

Convert JSON String Into Java Object,  Jettison Example

Here I am creating a pojo class, this will be the converted in to JSON string.

package net.javatips;

public class Student {

private String firstName="Rockey";
private String lastName="Desousa";

public String getFirstName() {
return firstName;

public void setFirstName(String firstName) {
this.firstName = firstName;

public String getLastName() {
return lastName;

public void setLastName(String lastName) {
this.lastName = lastName;

public String toString() {
return "Student [firstName=" + firstName + ", lastName=" + lastName + "]";

1 2 Next

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