您需要创建一个POGO,Jersey可以将JSON序列化为:
import javax.xml.bind.annotation.XmlRootElement;@XmlRootElementpublic class MyPojo { public int algID; public int[] verticies; public MyPojo() {} // constructor is required}然后 …
@POST@Consumes(MediaType.APPLICATION_JSON)@Path("getCloseness_vertices")public String getCloseness_vertices(MyPojo p) { int i = p.algID;}另外,您还需要包含jersey-
json jar文件。



