Home > Java > javaTutorial > How to set refresh page in jsp

How to set refresh page in jsp

(*-*)浩
Release: 2019-05-24 14:42:32
Original
3762 people have browsed it

This article will introduce how to set up JSP to refresh the page. In fact, there are many methods, but they must be adapted to local conditions to achieve better results.

How to set refresh page in jsp

Method 1

<metahttp-equiv="refresh"content="10;url=跳转的页面">
Copy after login

10 means refreshing every 10 seconds

Method 2

<scriptlanguage=&#39;&#39;javascript&#39;&#39;>
window.location.reload(true);
</script>
Copy after login

If you want to refresh an iframe, replace window with the name or ID number of the frame

Method 3

<scriptlanguage=&#39;&#39;javascript&#39;&#39;>
window.navigate("本页面url");
</script>
Copy after login

Method 4

function abc()
  {
  window.location.href="/blog/window.location.href";
  setTimeout("abc()",10000);
  }
Copy after login

Refresh this page:

Response.Write("<scriptlanguage=javascript>window.location.href=window.location.href;</script>")
Copy after login

Refresh the parent page:

Response.Write("<scriptlanguage=javascript>opener.location.href=opener.location.href;</script>")
Copy after login

Summary of refresh page implementation methods (HTML, ASP, JS)

##Refresh regularly:

<script>setTimeout("location.href='url'",2000)</script>
Copy after login
Description: url is the URL address of the page to be refreshed


2000 is the waiting time = 2 seconds,


<meta name="Refresh"content="n;url">
Copy after login
Description:


n, Is the waiting time, in seconds


url is the URL address of the page to be refreshed


<%response.redirect url%>
Copy after login
Description: Generally, a url parameter or form value is used to determine whether it occurs. An operation, and then refresh using response.redirect.

The above is the detailed content of How to set refresh page in jsp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
jsp
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template