Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Refresh image via JavaScript

Help
2007-07-31
2013-01-13
  • Oswaldo Dantas
    Oswaldo Dantas
    2007-07-31

    Hi,

    I'm developing a portlet that should show an image that should be refreshed every X seconds (only the image, not the browser because of other portlets).
    If I try to open the same image URL with Cewolf I get the same image, even if the data changed because the logic on the servlet doesn't get to the data producer.
    I'd like to know if there is any way I can change this behavior (some option, configuration, parameter somewhere...), so I can always get an image with the updated values, or I will have to create new code to get that functionality.

    For the refresh, I intend using an adaptation of the code found in http://www.htmlcodetutorial.com/help/archive.php/o_t__t_253__refresh-one-image-only.html

    Thanks,
    Oswaldo

     
    • Guido Laures
      Guido Laures
      2007-08-01

      The problem is that the img url points to a prerendered image on the server. Thus, same img id returns the same image.
      What you could do is to write a JSP that just returns the <img> tag and use AJAX technologies to incorporate this tag into your page dynamically. Cewolf needs a full JSP server roundtrip to render a new image.

      Regards
      Guido