• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reloading of JSP page

 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Kapil Agrawal
Greenhorn
Posts: 11
 
shikhar singh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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

 
Brett Knapik
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi,
Can somebody llok into the problem and help me.
Thanks
Shikhar
 
david david
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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..
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • 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...
http://www.coderanch.com/t/283691/JSP/java/Forcebly-translate-recompiling-JSP
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic