1 public static Map<String, String> xmlToMap(HttpServletRequest request) throws IOException, DocumentException {
 2 Map<String, String> map = new HashMap<>();
 3 SAXReader reader = new SAXReader();
 4 try(InputStream ins=request.getInputStream()){
 5 Document doc=reader.read(ins);
 6 Element root = doc.getRootElement();
 7 List<Element> list = root.elements();
 8 
 9 for (Element e : list) {
10 map.put(e.getName(), e.getText());
11 }
12 return map;
13 }
14 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-17
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-01-09
  • 2021-10-28
  • 2021-08-31
相关资源
相似解决方案