Automatically redirect from one JSP page to Another

后端 未结 2 1757
挽巷
挽巷 2020-12-06 17:05

Is it possible to redirect a user automatically to a second jsp page as soon as the home page loads?

相关标签:
2条回答
  • 2020-12-06 17:29

    With core JSTL libraries loaded <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> you can use:

    <c:redirect url="/home.html"/>
    
    0 讨论(0)
  • 2020-12-06 17:46

    There is an example of such a thing: JSP - Page Redirecting

    Simplest is using sendRedirect:

    public void response.sendRedirect(String location)
    throws IOException 
    
    0 讨论(0)
提交回复
热议问题