我想知道一个方法如何返回 List 的 JSON 数组,例如:
@GET
@Produces("application/json")
public List<String> aMethod(){
return Array.asList("text1", "text2", "text3");
}
我想知道,如何在我的方法中接收 List 参数类型,例如
@PUT
@Consumes("application/json") void otherMethod(List<String>){
// do something ;
}
我已经阅读了有关 JaxbContext 的信息,我了解它对我的帮助。