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
Margin_WalkerAsked:
Who is Participating?
 
Ryan ChongConnect With a Mentor Commented:
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
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.