两个ssm项目之间调用json返回

    @RequestMapping(value = "/aaaa",method = RequestMethod.POST)
    @ResponseBody
    @CrossOrigin(origins = "*", maxAge = 3600)
    public String getReagentNameList(HttpServletRequest request, HttpServletResponse response) throws IOException
    {
         URL url = new URL("http://localhost:8080/enotes01/exp/getUncheckJson?autoid=590");  
         URLConnection conn = url.openConnection();  
         InputStream stream  = conn.getInputStream();
          byte[] bytes = null;
          bytes = new byte[stream.available()];
          stream.read(bytes);
          String str = new String(bytes);
          return str;
    }
原文地址:https://www.cnblogs.com/zzsuje/p/ssm001.html