#Webservise

Опубликовано: 19 Декабрь 2019
на канале: WriteCodeWith Prince
739
6

#Webservise #jacksonAPI How to add Jackson API In eclipse and STS ID. And How to use it in the JSON
#er prince Kumar.
package com.app;

import org.codehaus.jackson.map.ObjectMapper;

public class Test {
public static void main(String[] args) {
try {

Student s=new Student();
s.setSid(10);
s.setSname("prince");

ObjectMapper om=new ObjectMapper();
String json=om.writeValueAsString(s);
System.out.println(json);

} catch (Exception e) {
e.printStackTrace();
}
}
}