READ JSON String in servlet

前端 未结 4 1720
我在风中等你
我在风中等你 2020-11-29 04:21

I am posting a jQuery AJAX POST to a servlet and the data is in the form of JSON String. Its getting posted successfully but on the Servlet side I need to read these key-val

4条回答
  •  不知归路
    2020-11-29 04:29

    If you just want to marshal it into a Map then try Jackson.

    ObjectMapper mapper = new ObjectMapper();
    ...
    Map data = mapper.readValue(request.getParameter("mydata"), Map.class);
    

提交回复
热议问题