zoukankan      html  css  js  c++  java
  • Response定时刷新浏览器

    1,ResponseRefresh Servlet实现定时刷新浏览器

        import java.io.IOException;  
        import javax.servlet.ServletException;  
        import javax.servlet.http.HttpServlet;  
        import javax.servlet.http.HttpServletRequest;  
        import javax.servlet.http.HttpServletResponse;  
        public class ResponseRefresh extends HttpServlet {  
            public void doGet(HttpServletRequest request, HttpServletResponse response)  
                    throws ServletException, IOException {  
                response.setHeader("refresh", "5");//5秒定时刷新网页  
                response.setContentType("text/html;charset=UTF-8");//告诉浏览器以UTF-8码表打开  
                response.setCharacterEncoding("UTF-8");//以UTF-8码发送浏览器请求  
                response.getWriter().write("您好!!");  
            }  
          
              
            public void doPost(HttpServletRequest request, HttpServletResponse response)  
                    throws ServletException, IOException {  
          
                doGet(request, response);  
            }  
          
        }  
  • 相关阅读:
    Gitlab使用腾讯企业邮箱
    查看Binlog内容
    微信小游戏手记
    clickhouse手记
    腾讯云手记
    go框架gin
    go idea debug
    go手记
    crontab手记
    Laravel-cors 跨域
  • 原文地址:https://www.cnblogs.com/lichone2010/p/3128075.html
Copyright © 2011-2022 走看看