Is it possible to redirect a user automatically to a second jsp page as soon as the home page loads?
是否可以在主页加载后立即将用户自动重定向到第二个jsp页面?
2 个解决方案
#1
1
There is an example of such a thing: JSP - Page Redirecting
有这样一个例子:JSP页面重定向
Simplest is using sendRedirect
:
最简单的是使用sendRedirect:
public void response.sendRedirect(String location)
throws IOException
#2
24
With core JSTL libraries loaded <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
you can use:
使用核心JSTL库加载<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>可以使用:
<c:redirect url="/home.html"/>
#1
1
There is an example of such a thing: JSP - Page Redirecting
有这样一个例子:JSP页面重定向
Simplest is using sendRedirect
:
最简单的是使用sendRedirect:
public void response.sendRedirect(String location)
throws IOException
#2
24
With core JSTL libraries loaded <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
you can use:
使用核心JSTL库加载<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>可以使用:
<c:redirect url="/home.html"/>