How can we refresh the servlet for every 2 minutes automatically?

Questions by sadashivarao   answers by sadashivarao

Showing Answers 1 - 3 of 3 Answers

Elizabeth Gladys

  • Jul 21st, 2006
 

We can Refresh Servlet Page by two ways..one through client side and another through server side.

Through Client Side : We use Meta http refresh

< META HTTP-EQUIV="Refresh" CONTENT="5; URL=/servlet/MyServlet/">

Through Server Side : Use Server Push

  Was this answer useful?  Yes

sreelakshmi.katneni

  • Jul 29th, 2006
 

u can use setHeader method of HttpServletRequest interface .this method takes two arguments.setHeader("refresh","15")....using this will refresh your page for every 15 seconds.

  Was this answer useful?  Yes

guest

  • Oct 10th, 2006
 

Hi,

      you are perfectly right in your explanation. but there is a small mistake in your writting. the refresh header is not a part of request header rather it is a header of response.

    response.setHeader("Refresh","300; URL=url");

the above statement will auto refresh the webpage to a new web page with url given. If you give the url as the same page where u r calling this from, then the web page will refresh for every 5 minutes. Hope I am correct. else correct me. thank you.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions