• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to avoid caching of JSP pages ?

 
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running an application on Tomcat 3.2.1 over a LAN. The problem is every time I make a change to a JSP page, I have to do the following:
1. Clear the local cache i.e., from the Temporary Internet Files Folder.
2. Clear the 'work' folder of the Tomcat (where the compiled-JSP .java files and .class files reside) which is running on the server.
3. And restart Tomcat !
The third one is highly irritating as I have to move to the server and then restart it. How I can avoid the above 3 steps as these take a considerable time out of my development work ? Any suggestions ?
------------------
Raghav.
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghav,
Try puttin in these tags in ur page.
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
Let me know if that helped.
Anup
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<% response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
if (request.getProtocol().equals("HTTP/1.1")){
response.setHeader("Cache-Control", "no-cache");
}%>
 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
both of the above didnt work
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this...
<META HTTP-EQUIV=Expires CONTENT=Fri, Jun 12 1981 08:20:00 GMT>
<META HTTP-EQUIV=Pragma CONTENT=no-cache>
<META HTTP-EQUIV=Cache-Control CONTENT=no-cache>
Place this in Head Tag...
Let me know whether it worked or not...
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, you should use all 4 of the following:
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-store">
Hope that this helps.
Eric
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
eric ur way does not seem to work for me!!!
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All of the above have to do with caching the pages on the CLIENT. If you're having problems where you want JSP changes to "take" then you have to not only ensure that the client requests an http reload, but the server has to detect that the page source code has changed and recompile it.
There are options in the tomcat server.xml to control this process. Also, try searching this newsgroup for other messages posted on the subject - it's not an uncommon problem.
 
Eric Klotzko
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim is absolutely correct.
Shame on me for not reading your items
more carefully. New compilation of JSPs
was not what I was referring to.
FYI, when I'm running IBM WebSphere 3.5 on
NT, I have to bounce the server every time
my beans or servlets are compiled to reflect
changes (but not JSPs).. However, this is not
the case when I'm running WebSphere on the
IBM OS/390 mainframe... perhaps platform plays
a role.. ?
Good hunting.. please post a resolution should you
find one.
Eric
 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The context tag in the server.xml file has the reloadble attribute set to true. What else do I need to do ?
I was searching this forum for related topics when i found the following topic:
Refreshing JSP and servlet in TOMCAT3.2 posted on July 12, 2001 with the same problem, but with no solution.
Seems some problem with Tomcat 3.2.1?

------------------
Raghav.
 
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
I'm using Tomcat 3.2.1 under WinNTSP6, and have no problems with this. Tomcat can tell when I make the smallest change, and will recompile.

But even if this doesn't work for a particular user, Tomcat restarts happen in seconds. This is not a mountain.

Now don't get me started about iPlanet...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic