actually this is the flow of displaying my dynamic image.

 1. a user clicks a link where he would then input different info that
will be use to generate the graph.

 2. in my servlet, it would call our utility class that would generate
the image base on the given info. the ".png" file would be save on
"webapps/stat/stat_image" directory.

 3. then i use a JSP to do the presentation, on the <img > tag i use
something like this <img src="stat_image\statistic.png" >.

 4. i am able to display the image, but only for one instance the
second time i click on the link and input another data the image would
not appear anymore.

 i created random image file name, but still doesn't work.

 what's your idea on this?


thanks a lot.



Mathias Hoggren wrote:
Hi!

You said your image was generated dynamically so I just assumed you used a
servlet or a jsp for that generation. My misstake, I didn't mean to confuse
you.

Anyway, your problem will be solved if you use the "random string" approach:

<img src="\stat_image\stat.png;<%=System.currentTimeMillis()%>">

Solution 2:
Create a filter to send no-cache headers and map it to *.png.

Brgds
Mathias


-----Ursprungligt meddelande-----
Fran: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:SERVLET-INTEREST@;JAVA.SUN.COM]For randie ursal
Skickat: den 13 november 2002 08:55
Till: [EMAIL PROTECTED]
Amne: Re: SV: NO CACHE on RESPONSE


you mean the "src" should point to a servlet to get the image?

because what i did was, i just let src point to the image directory
right away.

    ex. <img src="\stat_image\stat.png">

Mathias Hoggren wrote:

Hi!

The HTTP-headers you're setting only affects the HTML-page itself, the
inline images are fetched in a separate request and you'll have to set
theese headers in the jsp/servlet that creates the image too.

There is another way though, you could append a random string to the URL
in

the img-tag. This way the browser doesn't recognize the filename and it
will

not try to read it from it's cache. The string can be anything as long as
it's unique for the request.

<img

src="/myimgservlet?param1=value1&param2=value2;<%=System.currentTimeMillis()

%>" width=...>

Brgds
Mathias


-----Ursprungligt meddelande-----
Fran: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:SERVLET-INTEREST@;JAVA.SUN.COM]For randie ursal
Skickat: den 13 november 2002 07:12
Till: [EMAIL PROTECTED]
Amne: NO CACHE on RESPONSE


hi list,

 i tried to place this into one of my JSP page that i want to disable
cache, cause i have an image that is created dynamically. the problem is
when i access my web server, the browser displays HTTP 404 error or File
not found.

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>


  has anyone have any idea on this? i use IE6.0 and my TOMCAT is
running on Solaris 8.0 machine.


___________________________________________________________________________

To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body

of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


___________________________________________________________________________

To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body

of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html




--

Randie V. Ursal
Design Engineering Department
NEC Telecom Software Philippines, Inc.
office : +63(032) 233-9142 (loc.3119)
mobile : +63(0917) 467-8244
email  : [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html



--

Randie V. Ursal
Design Engineering Department
NEC Telecom Software Philippines, Inc.
office : +63(032) 233-9142 (loc.3119)
mobile : +63(0917) 467-8244
email  : [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to