Solved

refresh a page

Posted on 2004-04-30
7
1,397 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now