Jsp and image cache problem

Hello,
In a jsp(running on tomcat) I switch two jpg files(1.jpg and 2.jpg) and redirect to the page that displays them.
The problem is that the files are really changed, but the page which displayed them needs manual refresh to "know" they are inter-changed.
What I have tried, but no success:
1) In the page which displayed them, I have tried to setup header:
response.setHeader("cache-control","no-cache, no-store,must-revalidate, max-age=-1");
response.setHeader("pragma","no-cache, no-store");
response.setDateHeader ("expires", -1);no difference, in both IE(6 and 7) and Firefox 2.
Also no result with html:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">2) I have tried to a add a fake param on the images, like
<a href="1.jpg?<%=(new java.util.Date()).getTime() %">3) I have tried to add also a fake(time) parameter on the jsp which displayes the images, no result
How can I force the browser to know that I have inter-changed the images?
Any idea?
Thank you.</a>

to traja47 : could you be more specific about that post? Since there are 30,000 plus post about jsp and my sql, thank you very much.
to jSweep :
No exceptions.
just when i ran it, the page is all empty, then I used the VIEW-SOURCE of IE to see the source of the result page, it showed:
<html>
<head>
<title>Accessing data in a database</title>
</head>
<body>
</body>
</html>
all the parts related to java are gone. don't know why.

Similar Messages

  • Problem: codebase, jar and image reloading problem please help!

    Hi Java Gurus,
    I have written an applet that extends JApplet for viewing webcam. In order to reduce the download time I put my classes into a doorcam.jar file. The following is my <applet> tag in my html file.
    <applet code="CameraApplet.class"
    archive="doorcam.jar"
         codebase = "webcam/classes"
         width="375" height="475">
    <param name="imagePath" value="http://judge/webcam/images">
    <param name="webCamImage" value="door.jpg">
    <param name="COMPort" value="COM2">
    <param name="frameRate" value="10"> <!-- could not exceed more than 10-->
    <param name="host" value="judge">
    </applet>
    The fist problem is that my class file does not get loaded from the jar file if i provide the "codebase" attribute as above. Instead the browser load every single class file from the webserver. This has some problem too. Coz the browser sometimes just thorough NullPointerException or ClassNotFoundException. After much of debugging I found out that the problem is the IE browser which seldom fails to load classes or image file from the server. If i referesh the browser the applet and all its classes loaded successfully and runs smoothly. This behaviour never occurs when running with "appletviewer".
    I wanted all my classes to be loaded from my jar file. After much of trial and error I found out that if i remove "codebase" attribute the browser loads the classes from my jar file and applet loads very fast. This is where the second problem comes in. The browser does not reload my webcam image file so that the webcam become alive with live images, like before.
    If I run on "appletviewer" everything works fine my web cam is displayed properly. But in IE browser the image does not get reloaded when I refresh my image to give live to my webcam display. The refresh method is given below.
    private void refresh(final URL url) {
    Image webCamImage =getImage(url);
    webCamImage.flush(); // flush out the previous image
    webCamImage = getImage(url); // get a new image
    webCamImageIcon.setImage(webCamImage); webCamImageIcon.paintIcon(webCamLabel, webCamLabel.getGraphics(), 15, 15);
    When I add the "codebase" attribute back, the image gets reloaded for every refresh() and everything works fine. But the classes are also loaded from the server. And occasionally also suffers Class loading and image loading problem. As I presented earlier, when I do refreshing in the browser everything gets loaded and the applet function correctly with web cam displaying very well.
    The problem is so strange that I could not find any way to solve it.
    It would be a great help to me if somebody provide me some work around to the problem.
    I tested on Windows 2000, Windows XP, IE 5.5, IE 6 with J2SDK 1.4.0.
    Thank you all very much in advance.
    best regards,
    Judge

    Thank you so much for the suggestions. I did tried the way u suggested. The problem still the same.
    I think its the problem between IE browser and Java Plug-in.
    I which SUN would find these incompatibilities and solve these problems.
    I even tried using java SDK and plug-in 1.4.1 it even worst. It can't even load an applet. And it does not show any loading messages nor any error messages. It just show a cross sign on the upper left coner.
    I would be so glad, if Sun would try to eliminate the inconsistancies such as caching, loading, initializing etc between browser and its Java plug-In. For example, applets behave well in appletviewer and behave unpredictably in browser environment.
    I have seen so many people in the forums with all sorts of problems because of this.
    Right now I m desperately looking for work around to my problem.
    If somebody would provide me with the solution to my problem it would be a great help to me.
    thank you all so much.
    best regards,
    Judge

  • Setting OF LD_LIBRARY_PATH AND WEB CACHE PROBLEM [SHOWING PREVIOUS PAGE ]

    Dear Members,
    I would request for help regarding setting of LD_LIBRARY_PATH in Oracle 11G Application server and web cache problem when any single text file edit and save the result should not be changed . it shows previous page result.
    *1. Where to set LD_LIBRARY_PATH in Oracle11g Application Server (10.3.0) ? [  like in 9ias we set in opmn.xml . ] Where is opmn.xml file in oracle11g or which files contained LD_LIBRARY_PATH?*
    *2. When we created program generated report it shows correct result after some changes in file and generate again it shows first means previous page result as it is not take changes in that file. Even we tried out side made one .text file and open edit and save. It's given same result. So What is the problem regarding it?*
    It is the matter of  Browser Cache or WEB Cache. Where is the settings of it?
    *3. How to connect database (oracle11g Release 2) through OCI driver?*
    Regards
    Vipul Patel

    If you're compiling it yourself, you should set the library path then. If not, you can try something like this:
    env DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/add-on-libraries orca ...
    but I'm not sure it will work.

  • Mail attachment image caching problem with C7

    Using C7-00 and Mail for Exchange with up to date software. I received two Mobile Boarding Pass emails from Lufthansa for my flights. These emails contain barcode.gif as an attachment that one can show at the gate when boarding. Now the two emails contain attachment with same name (barcode.gif) and the images are equal in size too. The problem is that for the second mail the phone shows the attachment of the first email!
    I have read that Symbian^3 has for performance reasons aggressive image caching feature. But in this case this causes a real nasty bug!
     - Juha

    I have found a solution.
    In the IMG src tag we had been using /images/gfx/image.gif
    By changing this to /./images/gfx/image.gif the images are no longer cached and update immediately when changed.
    PQ

  • Mail attachment image caching problem

    Using C7-00 and Mail for Exchange with up to date software. I received two Mobile Boarding Pass emails from Lufthansa for my flights. These emails contain barcode.gif as an attachment that one can show at the gate when boarding. Now the two emails contain attachment with same name (barcode.gif) and the images are equal in size too. The problem is that for the second mail the phone shows the attachment of the first email!
    I have read that Symbian^3 has for performance reasons aggressive image caching feature. But in this case this causes a real nasty bug!
     - Juha

    I have found a solution.
    In the IMG src tag we had been using /images/gfx/image.gif
    By changing this to /./images/gfx/image.gif the images are no longer cached and update immediately when changed.
    PQ

  • I want to make a chatroom using jsp, and have some problem, Help!

    I want to build a chatroom using jsp and client using plain html, so i need every client could have a constant connection with the web server and will receive messages realtime. But i got 2 problems.
    First, how can i turn my buffers off so that messages can get to the client the time it is meant to be. I added
    <@page buffer="none">
    but seems that it takes no effect, any tricks here? thx
    Second, I want every user could have a constant conn. with server but i dont want my server to waste resources on those connection that has already been disconnected.so is it possible to stop executing JSP pages once client has diconnected.Since i found that it will throw no exception writing to the client even if the connection is disconnected in JSPs.
    Thanks!!!!!

    By theway, i'm using TOMCat 5.0 as my JSP container.

  • Scanner And Image Capture Problem

    Hello All,
    I thought I would start a new thread since my first one was answered.  The old thread is at:  https://discussions.apple.com/message/17757734#17757734
    Well, I went a couple weeks ok with the Scanner and Image Capture.  And then kaput, it doesn't work.  I thought about it some and it seemed to stop working after I did Software Update on March 17th, 2012.  In that update was a "Digital Camera Raw 3.1.0" update.  Which makes me very suspicious.
    Here is the error I get when I open Image Capture:
    So, it recognizes the scanner but can't do anything in Image Capture or the with the scanner buttons.
    I ran Software Update again, just to see if there was a new updated scanner driver but nothing came up.
    Any ideas?  I really want to avoid using the manufacturer's SW drivers etc.
    Thanks in advance for the help!

    PAHU,
    I feel like a complete idiot.  It was exactly the lock button.  The last time I finished using it, I locked it.  I totally forgot about it and I never thought of that being the problem to check.
    I really appreciate your help and thanks to you, I'm back and scanning!
    DMerz

  • CSS and Images export problems

    I am trying to export a page to dreamweaver using css and images method. I have created rectangles for the header, content and footer to create divs. Added text and graphics. When I export, it does not export with html codes and css, it gives me one big .jpg. "Layer_1.jpg".  Does anyone know what I'm doing wrong?
    Thanks,
    Wendy
    Message was edited by: wen8   I just found someone else with the exact same problem who said rebooting solved his problem. This also worked for me. Yeah!

    Problem fixed by rebooting!

  • CSS and image export problems

    Hi
    Is the CSS and image export supposed to output anything
    legible. Right now, it produces garbage that looks nothing like my
    project. Images are distorted. Nothing lines up correctly. Has
    anyone else had similar problems?
    Why does the feature only support creating a single page? Is
    there any way to get it to export all pages?
    Why does the feature ignore behaviors? The HTML and image
    export supports behaviors so why can't the CSS and image export? Is
    there any way to get it to support behaviors?
    Thanks

    Problem fixed by rebooting!

  • JSP and package deployment problem in Tomcat 5

    Hi,
    I tried very simple exercise that includes JSP and javabean (from package), but I have the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error ()
    that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    [javac] C:\jwsdp\work\Catalina\localhost\exercises\org\apache\jsp\ex01\ex01_jsp.java:10:
    package pack01 does not exist
    [javac] import pack01.ex01;
    [javac] ^
    Bellow are all my sources
    1. directory structure
    ========================
    C:\jwsdp\webapps\exercises
    index.html
    C:\jwsdp\webapps\exercises\ex01
    build.bat
    ex01.jsp
    C:\jwsdp\webapps\exercises\ex01\WEB-INF
    web.xml
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes\pack01
    ex01.class
    ex01.java
    C:\jwsdp\webapps\exercises\ex01\WEB-INF\lib
    pack01.jar
    2. sources
    ==========
    << ex01.jsp >>
    <HTML> <HEAD> <TITLE>Ex01</TITLE> </HEAD>
    <BODY>
    <FORM METHOD="GET" ACTION="ex01.jsp">
    <%@ page import = "pack01.ex01" %>
    <H2>Ex01</H2>
    <jsp:useBean id = "x" class = "ex01" scope="application"/>
    </FORM>
    </BODY> </HTML>
    << ex01.java >>
    package pack01;
    import java.io.*;
    public class ex01 implements Serializable {
    private String value;
    public ex01() {
    value = "EX01";
    public void setValue(String s) {
    value = s;
    public String getValue() {
    return value;
    << build.bat >>
    cd WEB-INF\classes\
    cd
    del ex01.jar
    javac -deprecation -verbose pack01\ex01.java
    jar cvf ..\lib\pack01.jar pack01\ex01.class
    << C:\jwsdp\webapps\exercises.xml >>
    <Context className="org.apache.catalina.core.StandardContext"
         cachingAllowed="true"
         charsetMapperClass="org.apache.catalina.util.CharsetMapper"
         configFile="webapps\exercises.xml"
         cookies="true"
         crossContext="false"
         debug="0"
         displayName="Exercises"
         docBase="C:\jwsdp\webapps\exercises"
         domain="Catalina"
         engineName="Catalina"
         j2EEApplication="none"
         j2EEServer="none"
         lazy="true"
         mapperClass="org.apache.catalina.core.StandardContextMapper"
         path="/exercises"
         privileged="false"
         reloadable="true"
         startupTime="30"
         swallowOutput="true"
         useNaming="true"
         wrapperClass="org.apache.catalina.core.StandardWrapper" >
    </Context>
    What is wrong ?
    I have Windows NT and Tomcat 5 (from jwsdp 1.2).
    Thank you,
    Alex.

    I just tried to reproduce the problem with old version of Tomcat (4.0.2) and ... it works. It is definitely specific for Tomcat 5 (or may be one of the late Tomcat 4 as well). There is another related difference:
    With Tomcat 4 I could create javabean in class subdirectory (default package) and use
    <%@ page import="ex01" %>
    Now with Tomcat 5 I have syntax error in this line.
    This syntax error disappeared when I moved javabean into package pack01.

  • OD Master and MCXD Cache Problem

    Hi,
    has someone an idea how to solve a mcxd Cache Problem?
    Always when I sate up the OD Master after a new installation of Mac OSX 10.4.11 Server, I get the mcxd problem after the reboot. After the reboot I have always this massage, see system.log in our system.
    SYSTEM.LOG
    Mar 5 21:45:23 mainserver /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd: DSGetLocallyHostedNodeNames(): dsFindDirNode() == -14008
    Mar 5 21:45:23 mainserver /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd: DSGetSearchPath(): DSGetLocallyHostedNodeNames() == -14956
    Mar 5 21:45:23 mainserver /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd: DSGetCurrentConfigInfo(): DSGetSearchPath() == -14956
    Mar 5 21:45:23 mainserver /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd: DSGetCacheInfo(): DSGetCurrentConfigInfo() == -14956
    Mar 5 21:45:23 mainserver /System/Library/CoreServices/mcxd.app/Contents/MacOS/mcxd: * MCXD.getComputerInfo: Couldn't get cache info -14956
    How can I solve this problem?
    This problem makes my crazy since 3 weeks.
    And is this problem known under Mac OSX Server 10.5?
    To our server system:
    One XServer G5 is the DNS Server and
    A second XServer G5 is the OD Master.
    Thanks for your help!

    Hi
    +"Is the replica truly read only?"+
    It should be. However I've come across a similar situation. At a site I support the local admin was creating users and editing passwords on the Replica rather than the Master. He kept getting the usual "dsDirectoryetc" errors but he persisted and eventually got the settings to 'take'. Querying the databases on both Master and Replica produced similar results to yours. It was difficult then to go back to the Master and 'redo' properly what he'd done as he'd not kept track of the changes he made. To 'fix' I simply demoted/repromoted the Replica which worked for me. Although time will tell if it turns out to be a permanent fix?
    Tony

  • CSS and Images Export problem

    Hello,
    I've created a very basic layout with a header, some columns of text and an image. Everything is aligned perfectly, I've put all the text into rectangles, created a slice for the image, and nothing is overlapping. When I use the Export CSS and Images option, it just exports everything as one big image. What am I doing wrong here?
    Thanks,
    Jason

    Sure, here you go:
    http://www.glowfoto.com/static_image/07-130236L/8862/png/04/2010/img6/glowfoto

  • Caching JSPs and images...

    I have recently started using pragma's to stop the browser caching jsp files:-
    response.setHeader("Pragma","No-cache");
    response.setHeader("Cache-Control","no-cache");
    response.setDateHeader("Expires",0);
    But will that stop the browser from caching images associated with the page ? I have a background image, which whilst not large, would cause alot of additional bandwidth consumption if it had to be downloaded with every jsp page request.
    Thanks.

    To be honest with you, the browser decides.
    The specification states that if you decide to refresh a web page, the browser should first check to see if there's a new version. If there have been no changes, it should use the version that's already in your "temporary files". The no cache directive is supposed to tell the browser not to bother checking, but go ahead and download the web page again.
    This applies for everything that's on the page. So yes, it would download the background again.
    However, I image that some of the latest generation browsers (such as Opera, Konq, Mozilla and Safari) bend the rules slightly. They recognize that an image is a background image because it's in the body tag, likely to be repeated throughout an entire site, and thus always checks for a new image regardless of whether you cache it or not.
    No cache is just a suggestion, not a requirement. If you're developing in a corporate workspace where everyone is using IE (for example), then I would go ahead and just test it.
    Keep in mind that if your JSP page has to dynamically generate content (usually by accessing a database), then the Servlet Engine always informs the browser that it is a new page. You don't need need to specify no cache in order to get the browser to always look for the most recent version.

  • JSP and images

    HI
    i have a problem with the images. i am not sure whether its because of the chart library or something in JSP. let me describe my problem :
    i my application [ which is web base, developed using JSP], i have to display graphs. the graph images are generated dynamically based of user selection and stuff. but my problem is that the images are generated fine, but the images which are displayed on the page are old images, so when i refresh the page i get to see the new images !!!
    i wonder why ! does anyone have a clue as to why i see old images of my grraphs even though the new ones have been generated !
    do write in ASAP if u have an idea as to why this happens or write in the solution !
    thanks in advance
    Vikram

    Maybe you should try Cewolf which is a chart tag library based on JFreeChart to generate all kinds of charts in a JSP. See http://cewolf.sourceforge.net.
    Regards,
    Guido

  • Image cache problem

    I´ve loaded the image in a movie, made some changes to
    it (masking) saved it in a temp folder in server via php and a
    button to load the result in a different frame within the same
    movie. The problem is that the image shown in the movie will
    allways be the one saved before, as it is saved in cache´s
    browser in both IE and Firefox. If I put the image directly in the
    server´s temp folder, via ftp, then the browser will show the
    latest image sucessfully.
    Any way to prevent browser to load cached image while playing
    the movie at runtime?
    Thanks in advance.

    Hi,
    I´ve tried to append a random number to the loadMovie
    (in fact in my case I have to use the loadClip function, but I
    don´t think this makes a difference), nevertheless it keeps
    loading the cached image in the browser, here is my code:
    stop();
    this.createEmptyMovieClip("Bezier2",this.getNextHighestDepth());
    //receive vars from first frame to create masking shape
    with (this.Bezier2) {
    lineStyle(0,999999,100);
    beginFill(0xFF0000);
    moveTo(posi1x,posi1y);
    lineTo(posi3x,posi3y,posi2x,posi2y);
    lineTo(posi2x,posi2y,posi1x,posi1y);
    lineTo(posi1x,posi1y,posi3x,posi3y);
    lineStyle(0,0xFF0000);
    lineTo(posi2x,posi2y,posi4x,posi4y);
    lineStyle(0,999999,100);
    lineTo(posi4x,posi4y,posi1x,posi1y);
    //make mc and initialize loading of image
    var holder = this.createEmptyMovieClip('holder', 0);
    var mcl = new MovieClipLoader();
    var lstn = new Object();
    mcl.addListener(lstn);
    //apply mask before image loading
    lstn.onLoadInit = function(clip) {
    clip.setMask(Bezier2);
    mcl.loadClip('../image1.jpg?a="+Math.random(9999));',
    holder);
    Any guess? Thanks

Maybe you are looking for

  • ITunes stuck on "Accessing iTunes Store"

    I posted in reply to a thread of complaints about this on the "iTunes for Mac" side but realized my error only afterwards and so am posting this here instead/as well; apologies for repetition, I have no idea what forum etiquette here is. I'm running

  • Incoming high school student: MacBook Air 13 in. or MacBook Pro 13 in.?

    Which one is a better school computer, for instance, for battery life, performance, portability, space etc. I have heard certain things about them but I am not sure if they are true. Anyone have one of these and would like to share their experiences?

  • Images in table

    I am very new to designing websites. I have created a home page using tables to seperate the elements. Basically I have created three columns. In the first column is the navigation bar. The second column has a graphic and the third column has a neste

  • Does a single transaction, spreeds accross multiple rollback segments?

    Hi, Does a single transaction, spreeds accross multiple rollback segments? What if , there is not enough space in the allocated rollback segment? Thanks Naveen.

  • Local Authenticator

    I'd like to know the exactly configuration of local authenticator on a AP1100. I try the configuration found on cisco documents, but it dosen't work. In particulary i use a AP like a RADIUS SERVER. Thanks NP