联系人列表为空,请先登录
是否可以在主页加载后自动将用户重定向到第二个 jsp 页面?
加载核心 JSTL 库后,<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>您可以使用:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:redirect url="/home.html"/>
有这样一个例子: JSP - Page Redirecting
最简单的是使用sendRedirect:
sendRedirect
public void response.sendRedirect(String location) throws IOException
加载核心 JSTL 库后,
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
您可以使用:<c:redirect url="/home.html"/>