. Method two, write window.location.reload(true) in js;"/> . Method two, write window.location.reload(true) in js;">

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

How to set refresh page in jsp

(*-*)浩
(*-*)浩Original
2019-05-18 19:04:053710browse

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=跳转的页面">

10 means refreshing every 10 seconds

Method 2

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

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>

Method 4

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

Refresh this page:

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

Refresh the parent page:

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

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

##Refresh regularly:

<script>setTimeout("location.href='url'",2000)</script>
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">
Description:


n, Is the waiting time, in seconds


url is the URL address of the page to be refreshed


<%response.redirect url%>
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!

Statement:
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
Previous article:How about java frameNext article:How about java frame