服务端通知浏览器3秒后转到目标页面
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了服务端通知浏览器3秒后转到目标页面相关的知识,希望对你有一定的参考价值。
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Demo2 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//服务端通知浏览器3秒后转到目标页面
response.setHeader("refresh","3;url=/day04/my.html");
}
}
http://localhost:8080/day04/Dome2
以上是关于服务端通知浏览器3秒后转到目标页面的主要内容,如果未能解决你的问题,请参考以下文章
认证后转到特定的jsp页面(spring security)