• 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

trouble showing up a gif image in included jsp

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Inside a jsp, i use <jsp:include > to show a gif image contained in a jsp. The <img> is coded in the included jsp is similar to the following:
<img src="http://localhost:8080/orgapp/view/picture.gif"/>
At first the image appears when run, but when i edit this portion, say change to another gif, and re-run it the image no longer shows. Even if i just re-save the included jsp and don't change anything, re-running will still not show the image.
the solution i discovered is to shutdown the browser and the current tomcat version i use (4.0.2), and then run the web app in another version (4.1.12 already installed) then the image would appear.
However if i again edit the included jsp, or simply re-save, the image will again not appear. I have to re-run again in the other (4.0.2) version to make it work.
This problem also happens if i start with the other version (4.1.12).
Has anyone encountered this and found a better solution, or better, how to prevent this from happening.
thanks in advance.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hy,
In you jsp, insert the follow code to prevent the cache.
response.setHeader("Pragma", "No-cache");
Bye.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tend to go a bit further and use this no-cache code:

Dave
 
boyet silverio
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes. many thanks Isaias and Dave. that also sowmehow now made my half baked understanding of caching well done.
reply
    Bookmark Topic Watch Topic
  • New Topic