Re: Facing Weird cache problem in JSP PAges

From: Tim Cross <tcross_at_pobox.une.edu.au>
Date: 10 Jul 2002 09:12:28 +1000
Message-ID: <87k7o4xzqb.fsf_at_blind-bat.une.edu.au>


jockey_sql_at_indya.com (jock) writes:

> I am facing a weird situation . I have a class, say clsMyClass written
> in Java
> and call this class from my JSP page.
> I make some code changes to the class. Compile and build them in the
> class directory using JDeveloper. Its simply not reflected in the JSP
> Page.
> tried almost everything and i am in the process of going nuts. Please
> help.
>

Just a few things to watch out for which may explain your problems. Note however, my experience with Java and jsp/applets has been on unix platforms, so I don't know what impact windows has. It has also been about 3 years since I've done any Java web stuff.

I do remember getting stung by a similar problem which turned out to be due to the JServe module not being restarted when I re-initialized Apache. This would mean the JServ module was still using the same *.class files it found when it first started.

It can also be useful to make sure your pages include the http "pragma: no-cache". Normally, web servers, proxies and browsers are configured to not cache files with a *.cgi etc suffix. However, it is possible that either one of these elements does not realize the jsp page is a dynamically created page and will attempt to cache it. Using the "expires" html header tag and setting it to something like 0-1 can sometimes help avoid this problem.

When you think you have restarted everything, check the status of the jvm process and make sure it has been restarted, turn off proxies if possible, try a shift+right-click when selecting the url of your page (this can force a reload even if the data appears to be available in a cache in some browsers).

Tim Received on Wed Jul 10 2002 - 01:12:28 CEST

Original text of this message