Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Servlet page to refresh the page every 3 mibutes

Ads

 
 

Share on Google+Share on Google+

ajay
Servlet page to refresh the page every 3 mibutes
1 Answer(s)      9 years ago
Posted in : Servlet Interview Questions

How can i refresh my Java Servlet page at time interval of three minutes?

Ads
View Answers

February 25, 2008 at 12:57 AM


Hi,

You can use the following attribute on your html(jsp or servlet generated ) page to refresh the page every 3 mibutes

<META HTTP-EQUIV="Refresh"
CONTENT="180; URL=http://www.yoursite.com/serlvet/">;

The contents of the "CONTENT" attribute consist of the number of seconds until the page load takes place, followed by a semicolon and a space, then "URL=" followed by the URL of the site to load. Note that the "URL=" part is within the "CONTENT=" parameter, not a separate parameter. 

Since this is an HTTP-EQUIV META tag, it is actually equivalent to sending a Refresh header in the server's actual HTTP headers. If you have control of this server-level stuff, you can do refreshes directly through the headers without having to insert a tag in your HTML documents

I should note, however, that the Refresh header doesn't appear in any of the standards documents regarding the HTTP protocol, so it is technically nonstandard (whether sent as a real header or a META tag), though widely supported.

You can even use javascript to achieve the same thing

<script language=JavaScript>
function Refresher(t) {
if(t) refresh = setTimeout("document.location=? http://www.yoursite.com/serlvet/?;";, t*1000);
}
</script>
And I call the script inside the BODY tag:
<BODY onLoad="Refresher(20)">

Where the parameter is the amount of seconds that IE should wait until refresh. 
I hope you find it useful.
Thanks

Ads









Related Tutorials/Questions & Answers:
Servlet refresh page
Servlet refresh page In this example we will show you how you can refresh your page from setting the refresh attribute from a servlet. response.setHeader... the browser to refresh the page after 10 seconds. In this will you can develop
page refresh - JSP-Servlet
up window has to close and jsp page has to refresh. how can i solve...page refresh  Hi All, I've done a login application using Ajax. I wrote jsp page having sign in option. when i click the sign in,pop up window
Advertisements
Click on Page Refresh - JSP-Servlet
Click on Page Refresh  hi ,i am working on jsp with mysql. i m facing a problem whenever i click on page refresh or f5 button, the value on form... then you redirect this page to another page. 2)Second alternative is to set
servelt refresh page
servelt refresh page   write a program in servlet that display the cricket score.the page should automatically refresh on every 5 seconds.the score... should fall down.the page should not refresh after 5 overs is completed
Refresh a Web Page Using In Servlet
example we develop an application to Refresh a web Page using Servlet. We...;   Step 2:Create a Servlet (timer.java) which refresh the page... .style1 { font-weight: bold; } Refresh a Web Page Using
Part refresh without a page refresh
Part refresh without a page refresh  hello, How do I submit a form or a part of a form without a page refresh?   hii, Ajax can do... page
refresh jsp page - Ajax
refresh jsp page  Code for refresh a web page in jsp.  Hi friend, function refreshpage() { window.location.reload
Page Refresh - Struts
Page Refresh   Hi How Can we control the page does not go to refersh after its forward again from action class.in my form i have one dropdownlist... in same page and fwd the action to same page
JSP Tutorials - Page 3
JSP Tutorials - Page 3
how to refresh my GUI page
how to refresh my GUI page  how to refresh a GUI in java
How to prevent the page refresh while submitting the form??
How to prevent the page refresh while submitting the form??  Hi... to the select of Dropdown1. Im hitting a db for this every time.Hence the page loads every time when changing Dropdown1. Is there any way in JAVA SCRIPT to prevent
Page is not getting loaded when I refresh the webpage???
Page is not getting loaded when I refresh the webpage???  **I am... getting header section always but page is not getting loaded after the header section when I refresh the page.* Note: Header section is getting loaded always Could
How To Page Refresh Using JavaScript In JSP
How To Page Refresh Using JavaScript In JSP...;   Step 3:Create a web page (userloginmid.jsp) to retieve...; Step 1: Create a web page(sign.jsp) to show a button to Login user. <
retrive data from data base and print it in every page until logout
retrive data from data base and print it in every page until logout  ... after completion of login he goto home page.inside home page i want to print the USER NAME through retriving from database.suppose from home page he go to next
refresh - JSP-Servlet
. Is there any other way to refresh that particular place instead of refreshing whole page... JSP project. In home page i like to logged members count dynamically... the whole page instead of refreshing the particular page. Logged member's
include a delete option in every row of table in a JSP page
include a delete option in every row of table in a JSP page  I have the following code of a JSP page........... <blockquote> <p>... the change on the page..............also if the user clicks on edit then he can
jsp page - JSP-Servlet
jsp page  what are elemets and template data in jsp page??  ... the embedded Java declaration statements to be inserted into the Servlet class... as part of the service method of the Servlet class. There are two ways to write
Java : Servlet Tutorials - Page 2
;15") refreshes the servlet after every 15 seconds till the servlet gets...; Servlet Tutorials Pages: Servlet Tutorials Page 1 | Servlet Tutorials... Java : Servlet Tutorials     
Page object - JSP-Servlet
Page object  Hello friends, How can we make use of PAGE object of implicit JSP object. If this is possible explain me about it's methods. I did not find any methods or explanation of this object. Pls help me
jsp dropdown refresh - JSP-Servlet
but the probleam during data extraction when i select first drop down its refresh then 2nd drop down it also refresh. so i cannot get the selected data. Please kindly give
Captcha Refresh - Jquery
Captcha Refresh - Jquery  I'm looking for an example to refresh the Captcha image in Jquery ..every time the page get refresh. Thanks.   $("#refresh").click(function() { $("#captcha").attr("src","captcha.php?r
Calling a jsp page from Servlet
Calling a jsp page from Servlet  How can I do this? Suppose I have jsp page aaa.jsp. From aaa.jsp on form action I have made a call to a servlet... List and data is being retrieve. Now I want to pass this List to another jsp page
Sorting a jsp page. - JSP-Servlet
Sorting a jsp page.  Hi there, It's me again. I tried to use Ajax... is process the code in the servlet. Here's the code in the jsp below: JSP Page Universal Books Home Page
jsp drop down without refresh - JSP-Servlet
jsp dropdown in jsp page,But the probleam is when i select first drop down its totaly reload the page and selected item is vanish, Similirally when i used 2nd... refresh and what change's is made in jsp of javascript to make proper data
Bangla web page - JSP-Servlet
Bangla web page   what is the process to make a bangla web page in jee
title and keywords don't refresh in webpage - JSP-Servlet
title and keywords don't refresh in webpage  Hi, I changed the title and keywords on my main jsp page that is the entry point into my web... and keywords. If I change anything else on the jsp page it refreshes
export jsp page - JSP-Servlet
export jsp page  i want to export jsp page in word and pdf format... code that export my jsp page in word and pfd format....  Hi Friend, Try the following code: 1)pdf.jsp: Name Address Contact
JSP error page - JSP-Servlet
JSP error page  Hi i have 1000 of JSP. but we coded it without adding the . but now i have to forward the page to the specific page when the exception occured in JSP. is there any short cut i can do? do not want to add this line
jsp page tags - JSP-Servlet
jsp page tags  Hi, Can anyone please explain me how to use Pager tags (http://jsptags.com/tags/navigation/pager/index.jsp). After getting the data from the database, how should we use that in these tags. Can you please
JSP Hindi Page - JSP-Servlet
JSP Hindi Page  I need to provide users with option to print a Certificate in English or Hindi. This is an html page generated by JSP Code. Depending upon the button clicked english or hindi version of the Certificate should
Client side refresh
by all browsers. <META HTTP-EQUIV="Refresh" CONTENT="5; URL=/servlet/MyServlet/"> This will refresh the page in the browser automatically and loads...Client side refresh  What is client side refresh?