Is it possible to redirect a user automatically to a second jsp page as soon as the home page loads?
加载核心JSTL库<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
您可以使用:
<c:redirect url="/home.html"/>
There is an example of such a thing: JSP - Page Redirecting
Simplest is using sendRedirect
:
public void response.sendRedirect(String location)
throws IOException
<% response.sendRedirect("anyPage.jsp"); %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.