wood burning stoves*
The moose likes JSP and the fly likes trouble showing up a gif image in included jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "trouble showing up a gif image in included jsp" Watch "trouble showing up a gif image in included jsp" New topic
Author

trouble showing up a gif image in included jsp

boyet silverio
Ranch Hand

Joined: Aug 28, 2002
Posts: 173
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

Joined: Jan 22, 2002
Posts: 165
Hy,
In you jsp, insert the follow code to prevent the cache.
response.setHeader("Pragma", "No-cache");
Bye.


Isaias
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I tend to go a bit further and use this no-cache code:

Dave
boyet silverio
Ranch Hand

Joined: Aug 28, 2002
Posts: 173
yes. many thanks Isaias and Dave. that also sowmehow now made my half baked understanding of caching well done.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trouble showing up a gif image in included jsp