refresh a page


Hello All

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

VolSpeakAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
TimYatesConnect With a Mentor Commented:
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
 
indigostarkCommented:
<META HTTP-EQUIV="refresh" CONTENT="5">

this will refresh the page every 5 seconds
0
 
VolSpeakAuthor Commented:

I just want it to refresh once, when the user loads it
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
TimYatesCommented:
<%
        // 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
 
VolSpeakAuthor Commented:

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

Im confused as to what you mean here

0
 
VolSpeakAuthor Commented:
<%
        // 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
 
TimYatesCommented:
should be :)

Good luck :)
0
All Courses

From novice to tech pro — start learning today.