@At("/save")
@Ok("json")
public void Save(HttpServletRequest request)
{
String json = request.getParameter("data");//data为student对象,有name、age、grade这些属性
HashMap<String, String> map=(HashMap) Json.fromJson(json);//此处写的好像不对
String name=map.get("name");
}
15 回复
@At("/save")
@Ok("json")
public void Save(HttpServletRequest request)
{
String json = request.getParameter("data");//data为student对象,有name、age、grade这些属性
HashMap<String, String> map=(HashMap) Json.fromJson(json);//此处写的好像不对
String name=map.get("name");
}
这是个List<Map>
@At("/save")
@Ok("json")
public void Save(@Param("data")String json_data) {
List<NutMap> list = Json.fromJsonAsList(NutMap.class, json_data);
NutMap map = list.get(0);
String name=map.get("name");
}
@At("/save")
@Ok("json")
public void Save(@Param("data")String json_data) {
List<NutMap> list = Json.fromJsonAsList(NutMap.class, json_data);
NutMap map = list.get(0);
String name=(String) map.get("name");
}
添加回复
请先登陆