自动从一个JSP页面重定向到另一个JSP页面

Ice*_*ine 13 java jsp

主页加载后,是否可以将用户自动重定向到第二个jsp页面?

Joh*_*k13 27

加载核心JSTL库后,<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>您可以使用:

<c:redirect url="/home.html"/>
Run Code Online (Sandbox Code Playgroud)

  • 当然,到处都是.你看起来吗?下面是一个示例http://www.devmanuals.com/tutorials/java/jsp/jstl/CoreTagRedirect.html和另一个http://www.tutorialspoint.com/jsp/jstl_core_redirect_tag.htm以及来自IBM http的一些说明:/ /www.ibm.com/developerworks/library/j-jstl0318/ (2认同)

小智 3

有一个这样的例子: JSP - 页面重定向

最简单的是使用sendRedirect

public void response.sendRedirect(String location)
throws IOException 
Run Code Online (Sandbox Code Playgroud)