SendRedirect after a time interval, avoiding javascript or php

How can i do the following

response.sendRedirect("index.jsp");

after a certain period of time from another jsp without using javascript or php?

The idea is to show the error in "error_page.jsp", and then after a while automatically redirect the user to the index page. Thanks in advance.

+5
source share
1 answer

Refresh HTTP header should control redirected redirects.

You can install it in HTML by adding to your error_page.jspmeta tag:

<meta http-equiv="Refresh" content="5;url=next_page.jsp">

(5 seconds 5 seconds before loading next_page.jsp)

, , , JSP , next_page.jsp ${param.nextPage} ${nextPage} .

, , : response.setHeader("Refresh", "5;url=next_page.jsp");.

JSP <% response.setHeader("Refresh", "5;url=next_page.jsp"); %>.

+18

All Articles