Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Servlet-Interview-Questions Servlet page to refresh the page every 3 mibutes
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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


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


Advertisement
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


Related Tutorials/Questions & Answers:
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
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
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
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 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
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
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
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
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
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
Bangla web page - JSP-Servlet
Bangla web page   what is the process to make a bangla web page in jee
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
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
how to design a jsp page via link which will expire after 3 days if not use?
how to design a jsp page via link which will expire after 3 days if not use?   Link is in a mail and if changes occur it will update in database
how to design a jsp page via link which will expire after 3 days if not use?
how to design a jsp page via link which will expire after 3 days if not use?   Link is in a mail and if changes occur it will update in database
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
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
Web 3
be personalize according to users? desire as every picture, every video clip, every
How to pass parametes from JSP page to HTML page? - JSP-Servlet
How to pass parametes from JSP page to HTML page?  Hi all, In my project I have one JSP page and one HTML page. In JSP page I have created HTML... with the username in HTML which I have called in JSP page. So I just want
web page altering while displaying servlet response
web page altering while displaying servlet response  in my application one index.jsp and one servlet is there and the servlet contains some db code and i want to display response of that servlet in a div in my index.jsp
staying in same page after deliting arow in jsp page - JSP-Servlet
staying in same page after deliting arow in jsp page  Hello Sir, I want to stay back in current jsp page after deleting row in jsp table. how can i do this. need help from you. thanks, nandini  Hi friend
Advertisements
 

 

 

DMCA.com