Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble showing up a gif image in included jsp  RSS feed

 
boyet silverio
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • 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.
 
Isaias C. Barroso
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy,
In you jsp, insert the follow code to prevent the cache.
response.setHeader("Pragma", "No-cache");
Bye.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
yes. many thanks Isaias and Dave. that also sowmehow now made my half baked understanding of caching well done.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!