Solved

refresh a page

Posted on 2004-04-30
7
1,400 Views
Last Modified: 2010-04-01

Hello All

How can I invoke a .jsp page to refresh/reload?

0
Comment
Question by:VolSpeak
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:indigostark
ID: 10959247
<META HTTP-EQUIV="refresh" CONTENT="5">

this will refresh the page every 5 seconds
0
 

Author Comment

by:VolSpeak
ID: 10959438

I just want it to refresh once, when the user loads it
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10959826
<%
        // Set to expire far in the past.
        response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

        // Set standard HTTP/1.1 no-cache headers.
        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");

        // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
        response.addHeader("Cache-Control", "post-check=0, pre-check=0");

        // Set standard HTTP/1.0 no-cache header.
        response.setHeader("Pragma", "no-cache");
%>

At the top of the jsp should (might) stop the user from caching it, so they will see the new copy every time...

Some versions of IE don't care at all, and some proxy servers will ignore these settings, thus screwing you up...

Then, you need to try putting dummy random into the URL line...
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:VolSpeak
ID: 10959842

>>Then, you need to try putting dummy random into the URL line...

Im confused as to what you mean here

0
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 10960028
When you link to the URL for the page, make the url something like:

String url = "whatever.jsp?time=" + System.currentTimeMillis() ;

So that the URL is different every time, thereby fooling rubbish proxy servers :-)
0
 

Author Comment

by:VolSpeak
ID: 10960375
<%
        // Set to expire far in the past.
        response.setHeader("Expires", "Sat, 6 May 1995 12:00:00 GMT");

        // Set standard HTTP/1.1 no-cache headers.
        response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");

        // Set IE extended HTTP/1.1 no-cache headers (use addHeader).
        response.addHeader("Cache-Control", "post-check=0, pre-check=0");

        // Set standard HTTP/1.0 no-cache header.
        response.setHeader("Pragma", "no-cache");
%>

So I just put this in my index.jsp and everytime index.jsp is visited it will be refreshed. Im using mozilla with apache tomcat.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10962616
should be :)

Good luck :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 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