import com.alibaba.fastjson.JSON;

        String strjson = request.getParameter("param");

        //url-json的转码解码
        String urlJson = URLEncoder.encode(strjson, "UTF-8"); 
        String strJson = URLDecoder.decode(urlJson, "UTF-8");

        //fastjson的转码解码
        Map<String, Object> paramlist = (Map<String, Object>) JSON.parse(strjson);
        String jsonStr = JSON.toJSONString(paramlist);
        
        //string和数组的转换,用,分割
        String ipArray [] = {"192.168.1.16","192.168.1.17","192.168.1.18"} ;
        String str = StringUtils.join(ipArray, ",");
        String [] strArr= str.split(",");

 

 

over

 

相关文章:

  • 2022-02-06
  • 2021-09-06
  • 2021-09-15
  • 2021-06-12
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2021-11-24
  • 2021-12-25
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案