package Book;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/resrtest")
public class Test {
@GET
@Produces({MediaType.APPLICATION_JSON})
public Student datareturn() {
Student student = new Student();
student.setName("ram");
student.setAge(29);
student.setSection("A");
student.setRoll(11);
student.setFathername("sam");
student.setSchoolname("ANC");
return student;
}
}
输出:
{"名称":"夯""辊":11,"年龄":29," fathername&# 34;:" SAM""名称":"夯""辊":11," schoolname&#34 ;: " ANC""节":" A"}
为什么Name和Roll会重复?