jsp 定时刷新

package com.java.contorl;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**

  • 定时刷新

  • Servlet implementation class RefreshDemo1
    */
    public class RefreshDemo1 extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setHeader(“Refresh”, “3;url=/web6/index.html”);//定时刷新跳转
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(request, response);
    }

}

你可能感兴趣的:(jsp 定时刷新)