@GetMapping("/yzZgw")
  public void addField(HttpServletResponse response) throws IOException {
    List<String> list = yzDzGw();// 要输出的数据

    // 设置响应内容类型
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html");

    // 获取输出流对象
    PrintWriter out = response.getWriter();

    // 输出内容到浏览器
    out.println("<html>");
    out.println("<head><title>Output to Browser</title></head>");
    out.println("<body>");
    for (String msg : list) {
        out.println(msg+"<br>");
    }
    out.println("</body></html>");

    // 关闭输出流
    out.close();

}
posted on 2025-10-27 16:53  黎明前的守护  阅读(4)  评论(0)    收藏  举报