代码之家  ›  专栏  ›  技术社区  ›  this_is_om_vm

运行弹簧防尘套执行器时出现异常行为

  •  0
  • this_is_om_vm  · 技术社区  · 6 年前

    下面是我处理healthStaus的控制器部分

     public ModelAndView healthStatus() {
            ModelAndView view= new ModelAndView();
            final String uri = "http://localhost:8090/actuator";
            RestTemplate restTemplate = new RestTemplate();
            String response=restTemplate.getForObject(uri,String.class);
           try {
               Object ob=new ObjectMapper().readValue(response, Employee.class); }
               catch (IOException e){
               e.printStackTrace();
               }
            view.addObject("objects",ob);
            view.setViewName("dashboard");
            return view;
        }
    

    虽然执行时请求句柄位于代码的这一部分,但它显示了一种奇怪的行为。它会自动下载一个与url同名的文件。 enter image description here

    0 回复  |  直到 6 年前