Solved

Go back and refresh

Posted on 2004-04-27
8
623 Views
Last Modified: 2012-05-04
Hi,

I'm using Javascript with JSP and after running a query I am using the Go- back method in Javascript.

The problem is when the page goes back it needs to refresh so the update will take place.

Please help
0
Comment
Question by:Pigdogmonster
  • 4
  • 3
8 Comments
 
LVL 2

Expert Comment

by:TheImmortal
Comment Utility
Rather than use the history, you can get the page that called your query JSP from the Referrer header and redirect to it. This will cause the calling page to reload/refresh.  
0
 

Author Comment

by:Pigdogmonster
Comment Utility
ok - how do i do that? :-)
0
 
LVL 2

Accepted Solution

by:
TheImmortal earned 20 total points
Comment Utility
Your JSP would look something like this:

<%

refpage = request.getHeader("referrer");

/**
   * Query stuff
   */

response.redirect(refpage);

%>
0
 

Author Comment

by:Pigdogmonster
Comment Utility
I think I know what you are saying and I have tried doing it that way i.e. re-run the query but I canot get it to work!


I did get go back and refresh thing to work once,  I think I used something like

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />

on the page but for some reason this does not refresh the page,  all I what is for the page to refresh itself!  How hard can this be?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 2

Expert Comment

by:Zeyadss
Comment Utility
Maybe if you give me the code you are using at current, and I can probably solve the problem.
0
 

Author Comment

by:Pigdogmonster
Comment Utility
well the problem seems only to be local to my machinen and works fine on my collegues?

0
 
LVL 2

Expert Comment

by:TheImmortal
Comment Utility
Most likely your Cache settings are not set to check for new version of the page upon every visit. Look at your Tools - > Internet Options -> Temporary Internet File Settings (if you are using IE).
0
 
LVL 2

Expert Comment

by:TheImmortal
Comment Utility
Most likely your Cache settings are not set to check for new version of the page upon every visit. Look at your Tools - > Internet Options -> Temporary Internet File Settings (if you are using IE).
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 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

14 Experts available now in Live!

Get 1:1 Help Now