Solved

auto refresh

Posted on 2004-05-01
5
450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 51

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 51

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 51

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
attribute vs parameter and setter vs add method 17 94
oracle fusion vs MQ 2 129
login form jsp example 2 56
jsp login check 12 54
The world seems to conceive of a curious bubble separating IT from “the business.”  More so than just about any other pursuit in the commercial world, people think of IT as some kind of an island.
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.

696 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