• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 457
  • Last Modified:

auto refresh

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
Margin_Walker
Asked:
Margin_Walker
  • 3
  • 2
1 Solution
 
Ryan ChongCommented:
Try add meta tag like:

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

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

cheers

0
 
Ryan ChongCommented:
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
 
Margin_WalkerAuthor Commented:
Thats brilliant it works perfectly. Thanks.  But can you just explain to me what the if else block of code is doing.
0
 
Ryan ChongCommented:
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
 
Margin_WalkerAuthor Commented:
Thats great thanks.
Margin_Walker
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now