接口被调用 返回jsonArray 处理jsonArray数据

阅读更多
 
 @RequestMapping(value = "/querySource.htm", method = RequestMethod.POST)
public String init(HttpServletRequest request ) throws IOException {

Map map = new HashMap();
        Enumeration fields = request.getParameterNames();

        while(fields.hasMoreElements())
        {
            String field = (String) fields.nextElement();
            String[] values = request.getParameterValues(field);
            if (values.length > 1)
                map.put(field, values.toString());
            else
                map.put(field, values[0]);
        }
        logger.info("***接口返回jsonArray:"+map.get("jsonArray"));




if(map.get("jsonArray")!=null && map.get("jsonArray").length()>0){
 String arrayStr = map.get("jsonArray");

            List postAccountVOList = new ArrayList();

            List> listObjectSec = JSONArray.parseObject(arrayStr,List.class);
            Map mapList = new HashMap();
            for(int i=0;i 
  

对方是以http的方式访问我的就接口

你可能感兴趣的:(接口,jsonArray,jsonArray转对象)