Solved

auto refresh

Posted on 2004-05-01
5
446 Views
Last Modified: 2010-04-01
I have a server client type system running and i need a way to automatically refresh a jsp page so that new orders from clients will appear on the server page.  Is this possible with jsp?
Thanks
Margin_Walker
0
Comment
Question by:Margin_Walker
  • 3
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 10970656
Try add meta tag like:

<META HTTP-EQUIV="REFRESH" Content="20">

where the page will auto-refresh on every 20 seconds.

cheers

0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 10970662
also try add this at the top of your JSP pages, to remove the page cache if necessary:

<%
      if (request.getProtocol().compareTo("HTTP/1.0") == 0)
      {
            response.setHeader("Pragma", "no-cache");
      }
      else if (request.getProtocol().compareTo("HTTP/1.1") == 0)
      {
            response.setHeader("Cache-Control", "no-cache");
      }
      
      response.setDateHeader("Expires", 0);
%>

regards
0
 

Author Comment

by:Margin_Walker
ID: 10998754
Thats brilliant it works perfectly. Thanks.  But can you just explain to me what the if else block of code is doing.
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 11002491
The code above remove the page cache, so that each time you load this page, it will get the content from server, instead of from cache.

Hope this is clear. cheers
0
 

Author Comment

by:Margin_Walker
ID: 11006510
Thats great thanks.
Margin_Walker
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now