• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

reloading of JSP page

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am loadin the Jsp page in a particular frame with the help of 'open()' function as given below,
open("nameofpage.jsp", "framewheretoload");
But my problem is:
First time the browser loads the Jsp page properly with all the values fetched and displyed in a drop-down-list box. These values are fetched from database.
But if I change these values from some other page and comes back to the previous one, the latest values are not displayed (jsp is not reloaded), and the old page is loaded again.
This is I think due to the caching of the browser.
But If I clear the cache of the browser and work again it works fine.
Can anybody suggest me a way to code the jscript in such a way that everytime it reloads the JSP page and displays the updated data.
Kindly send me your suggestions.
Hope to get some help
thanks in advance
shikhar
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a fairly well known problem, and the solution depends on which browser(s) you want to support. I do most of my testing with Netscape, for which I know you need to send a "pragma: no-cache" header to prevent the broswer caching the page. There is another way of doing it for IE, but I don't have that to hand.
Search here and on the net in general and you should find the answer fairly quickly.
 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frank,
Thanks very much for the reply. I am using IE as my browser. I tried to look on the net but couldn't find any help. Can you tell me whether I can use the same command you've given for IE also. If yes, can you give me the exact syntax and where to put this. Or can you suggest me some site which could be helpful.
Thanks for you patience and help..
Shikhar
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These links could be of some help to you:
http://support.microsoft.com/support/kb/articles/Q234/0/67.ASP
and http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP
 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
Thanks for the help. I've tried the following code in the HTML.:
<HTML><HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</HEAD><BODY>
</BODY>
</HTML>
But this is not helping me. The problem still persists.
Actually let me explain the whole thing:
I have a JSP page called whole.jsp, which has two frames as under:
"
<frame name="rulesMain" src="rulesmain.jsp marginwidth="0">
<frame name="ruleDetail" scrolling="auto" marginwidth="0">
"
Now in first frame the source file is rulesmain.jsp.
In rulesmain.jsp I call a Jscript function, which in turn loads the JSP file called rulesdetail.jsp in the second frame i.e. ruleDetail, by calling this function:
"
open("rulesdetail.jsp",RuleDeail");
"
This function loads the JSP in second frame.
Now everytime I loads whole.jsp, It first loads rulemain.jsp and then loads rulesdetail.jsp.
Now my problem is that when I reloads the page whole.jsp, it reloads the rulesmain.jsp to the first frame with latest data but does not reloads rulesdetail.jsp. It just takes the page from the IE cache and displays the page with old data.
Hope this makes sense and is clear.
Pl help me and give me some helpful suggestion.
Thanks in advance
Shikhar

 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont know if this will help but in the apache conf filet here is an option for cacheing i dont know if it pertains to the browser or the web server
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brett,
I think that might pertain to the web server, not the browser.
thanks
Shikhar
 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can somebody llok into the problem and help me.
Thanks
Shikhar
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the same problem, some how the tomcat did not reload the jsp.
Any pro. can help us? --JSP pro please..
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I faced the same problem a few days back...
Tried all the things that u specified...
The problem is not related to caching, etc...
It is related to the use of frames...
Check what you have specified as the target for the frames...
Also take a look at the question i had posted...
and the solutions i had got...
https://coderanch.com/t/283691/JSP/java/Forcebly-translate-recompiling-JSP
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to try the following:

<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">

also, if you're going to be using your browser for development, then turn off all the caching in your browser, just to be 100% sure.
 
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic