You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Adress, David S." <Da...@pfizer.com> on 2000/12/05 15:14:58 UTC

FW: Tomcat, JSP and Cache

I was wondering if anyone can help. I have tomcat server 3.1 running a
servlet and jsp page.
I have a servlet calling a jsp page with the redirect method. I've put the
required meta tags on the jsp page  so the page should not cache. However,
the page is still caching. In order for my page to display the proper
results I need to have my browser reload. Are there any setups that need to
be done to Tomcat or do I need to have a web server running also????
 
Thanks

-----Original Message-----
From: Pier P. Fumagalli [mailto:pier@betaversion.org]
Sent: Monday, December 04, 2000 3:49 PM
To: Adress, David S.; 'webmaster@jakarta.apache.org'
Subject: Re: Tomcat, JSP and Cache


Adress, David S. <Da...@pfizer.com> wrote:
> 
> I was wondering if you can help.

Nope, I'm sorry... You'd better contact the Tomcat USERS mailing list. Check
out <http://jakarta.apache.org/mail.html>

    Pier

> I have tomcat server running a jsp page.
> I've put the required meta tags so the page should not cache. However, the
> page is still caching. In order for my page to display the proper results
I
> need to have my browser reload. Are there any setups that need to be done
to
> Tomcat ???
> 
> Thanks
> 
-- 
Pier P. Fumagalli  Apache Software Foundation  <ma...@betaversion.org>
----------------------------------------------------------------------------
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur,
adipisci velit...                             (Cicero: "De Finibus" 1.10.32)


Re: FW: Tomcat, JSP and Cache

Posted by Kurt Bernhard Pruenner <le...@gmx.at>.
"Adress, David S." wrote:
> I was wondering if anyone can help. I have tomcat server 3.1 running a
> servlet and jsp page.
> I have a servlet calling a jsp page with the redirect method. I've put the
> required meta tags on the jsp page  so the page should not cache. However,
> the page is still caching. In order for my page to display the proper
> results I need to have my browser reload. Are there any setups that need to
> be done to Tomcat or do I need to have a web server running also????

I've come to the conclusion that Internet Explorer is way beyond broken when
it comes to _NOT_ cache a page. Therefore, I've solved the problem by sending
a query parameter containing a random value to every page I don't want to have
cached - it will get cached, but the new URL will be different so IE will
still reload it...

If you're using <meta http-equiv="refresh" ...>, I believe adding a bogus
request parameter to your query string in the URL to redirect to might solve
your problem...

Of course, this is just treating symptoms and not curing anything, but at
least it works... :/

-- 
Kurt Bernhard Pruenner --- Haendelstrasse 17 --- 4020 Linz --- Austria
Music: http://www.mp3.com/Leak --- Work: http://www.ssw.uni-linz.ac.at
.......It might be written "Mindfuck", but it's spelt "L-A-I-N".......
np: Biosphere - Le Grand Dome (Cirque)

RE: Tomcat, JSP and Cache

Posted by Jacob Kjome <ja...@syntegra.com>.
Kim,

It looks like you are heavily involved in working on bug fixes for 
Tomcat.  Given that, I would suggest you get in contact with someone at the 
Apache Group and see if you can't get more access.  From my perspective, it 
looks like your involvement would be both rewarding to you and very 
beneficial to the whole Jakarta community.

Jake


At 11:05 AM 12/7/2000 +0900, you wrote:
>Hi,
>
>Tomcat 3.x and 4.0 have a Cache-Control Bug.
>But, none of Tomcat commiters know that.
>Because I am not a commiter, I cannot fix the Bug of Tomcat.
>
>Try to check my page:
>
>     http://www.javaclue.org/tomcat/patch32/dopatch.html
>
>
>Kim
>
>
>
>On Wed, 6 Dec 2000, Paulo Gaspar wrote:
>
> > That looks more like a browser/proxy issue.
> >
> > Notice that:
> >  - Internet Explorer often caches pages when it should NOT do it;
> >  - Internet Explorer sometimes even uses a cache copy when you refresh;
> >  - Some browsers ignore those meta tags.
> >  - Proxies (usualy) ignore those meta tags.
> >
> > Solutions I use:
> >  - To control page caching I use HTTP headers;
> >  - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
> >    page doesn't look so good but caching and refresh realy work in a
> >    predictable way.
> >
> > For more info on caching issues and the relevant HTTP headers read...
> >
> > Basics and HTTP headers:
> >   http://www.netapp.com/products/netcache/cache_basics.html
> >
> >   http://www.mnot.net/cache_docs/
> >   or http://www.web-caching.com/mnot_tutorial/notes.html
> >
> > THE web caching site:
> >   http://www.web-caching.com/
> >
> > On Proxy caches:
> >   http://info.connect.com.au/docs/proxy/faq.html
> > and, if you like RFCs:
> >   http://www.faqs.org/rfcs/rfc2187.html
> >
> >
> > Have fun,
> > Paulo Gaspar
> >
> >
> > > -----Original Message-----
> > > From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> > > Sent: Tuesday, December 05, 2000 15:15
> > >
> > >
> > > I was wondering if anyone can help. I have tomcat server 3.1 running a
> > > servlet and jsp page.
> > > I have a servlet calling a jsp page with the redirect method. I've 
> put the
> > > required meta tags on the jsp page  so the page should not cache. 
> However,
> > > the page is still caching. In order for my page to display the proper
> > > results I need to have my browser reload. Are there any setups
> > > that need to
> > > be done to Tomcat or do I need to have a web server running also????
> > >
> > > Thanks
> > >
> > > -----Original Message-----
> > > From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> > > Sent: Monday, December 04, 2000 3:49 PM
> > > To: Adress, David S.; 'webmaster@jakarta.apache.org'
> > > Subject: Re: Tomcat, JSP and Cache
> > >
> > >
> > > Adress, David S. <Da...@pfizer.com> wrote:
> > > >
> > > > I was wondering if you can help.
> > >
> > > Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> > > list. Check
> > > out <http://jakarta.apache.org/mail.html>
> > >
> > >     Pier
> > >
> > > > I have tomcat server running a jsp page.
> > > > I've put the required meta tags so the page should not cache.
> > > However, the
> > > > page is still caching. In order for my page to display the
> > > proper results
> > > I
> > > > need to have my browser reload. Are there any setups that need
> > > to be done
> > > to
> > > > Tomcat ???
> > > >
> > > > Thanks
> > > >
> > > --
> > > Pier P. Fumagalli  Apache Software Foundation
> > > <ma...@betaversion.org>
> > > ------------------------------------------------------------------
> > > ----------
> >
> >


Re: Tomcat, JSP and Cache

Posted by "Julio Serje (@canada.com)" <js...@home.com>.
As a suggestion, to help making sure that a page is not  cached, add a
random parameter to the link, something like

<a href="whateverlink.html?rnd=<%=(int)(Math.random()*1000)%>

So at least every time the user reload this page the link will be different.
Of course this technique presents limitations (for example, the index pages,
etc) but may help in many cases.  This is a simple and practical workaround,
one that do not depend on a specific browser, proxie or.... type of user...
while Pilho Kim patch is considered by the developers and the bug is fixed..

We used this approach with a servlet that was used as the SRC of an IMG. The
servlet rendered a diferent image each time the page was served, but the
cache of the browser was just displaying the last version of the image. In
this case Pilho's bug wont fix the problem, but the random parameter will.


Julio


----- Original Message -----
From: Pilho Kim <ph...@math.soongsil.ac.kr>
To: Tomcat-Dev <to...@jakarta.apache.org>
Cc: <to...@jakarta.apache.org>
Sent: Wednesday, December 06, 2000 9:05 PM
Subject: RE: Tomcat, JSP and Cache


> Hi,
>
> Tomcat 3.x and 4.0 have a Cache-Control Bug.
> But, none of Tomcat commiters know that.
> Because I am not a commiter, I cannot fix the Bug of Tomcat.
>
> Try to check my page:
>
>     http://www.javaclue.org/tomcat/patch32/dopatch.html
>
>
> Kim
>
>
>
> On Wed, 6 Dec 2000, Paulo Gaspar wrote:
>
> > That looks more like a browser/proxy issue.
> >
> > Notice that:
> >  - Internet Explorer often caches pages when it should NOT do it;
> >  - Internet Explorer sometimes even uses a cache copy when you refresh;
> >  - Some browsers ignore those meta tags.
> >  - Proxies (usualy) ignore those meta tags.
> >
> > Solutions I use:
> >  - To control page caching I use HTTP headers;
> >  - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
> >    page doesn't look so good but caching and refresh realy work in a
> >    predictable way.
> >
> > For more info on caching issues and the relevant HTTP headers read...
> >
> > Basics and HTTP headers:
> >   http://www.netapp.com/products/netcache/cache_basics.html
> >
> >   http://www.mnot.net/cache_docs/
> >   or http://www.web-caching.com/mnot_tutorial/notes.html
> >
> > THE web caching site:
> >   http://www.web-caching.com/
> >
> > On Proxy caches:
> >   http://info.connect.com.au/docs/proxy/faq.html
> > and, if you like RFCs:
> >   http://www.faqs.org/rfcs/rfc2187.html
> >
> >
> > Have fun,
> > Paulo Gaspar
> >
> >
> > > -----Original Message-----
> > > From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> > > Sent: Tuesday, December 05, 2000 15:15
> > >
> > >
> > > I was wondering if anyone can help. I have tomcat server 3.1 running a
> > > servlet and jsp page.
> > > I have a servlet calling a jsp page with the redirect method. I've put
the
> > > required meta tags on the jsp page  so the page should not cache.
However,
> > > the page is still caching. In order for my page to display the proper
> > > results I need to have my browser reload. Are there any setups
> > > that need to
> > > be done to Tomcat or do I need to have a web server running also????
> > >
> > > Thanks
> > >
> > > -----Original Message-----
> > > From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> > > Sent: Monday, December 04, 2000 3:49 PM
> > > To: Adress, David S.; 'webmaster@jakarta.apache.org'
> > > Subject: Re: Tomcat, JSP and Cache
> > >
> > >
> > > Adress, David S. <Da...@pfizer.com> wrote:
> > > >
> > > > I was wondering if you can help.
> > >
> > > Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> > > list. Check
> > > out <http://jakarta.apache.org/mail.html>
> > >
> > >     Pier
> > >
> > > > I have tomcat server running a jsp page.
> > > > I've put the required meta tags so the page should not cache.
> > > However, the
> > > > page is still caching. In order for my page to display the
> > > proper results
> > > I
> > > > need to have my browser reload. Are there any setups that need
> > > to be done
> > > to
> > > > Tomcat ???
> > > >
> > > > Thanks
> > > >
> > > --
> > > Pier P. Fumagalli  Apache Software Foundation
> > > <ma...@betaversion.org>
> > > ------------------------------------------------------------------
> > > ----------
> >
> >
>


NullPoint error in getRequestDispatcher(nextPage).forward

Posted by Haizheng Zhang <ag...@hotmail.com>.
 
    request.setAttribute(str,xx);
    ServletContext sc = getServletConfig().getServletContext();
   
    sc.getRequestDispatcher(nextPage).forward(request, response);

it seems that it could not find the Nextpage, but how should I config the
path

Thanks


Re: Tomcat, JSP and Cache

Posted by Jon Stevens <jo...@latchkey.com>.
on 12/6/2000 6:05 PM, "Pilho Kim" <ph...@math.soongsil.ac.kr> wrote:

> Hi,
> 
> Tomcat 3.x and 4.0 have a Cache-Control Bug.
> But, none of Tomcat commiters know that.
> Because I am not a commiter, I cannot fix the Bug of Tomcat.
> 
> Try to check my page:
> 
> http://www.javaclue.org/tomcat/patch32/dopatch.html
> 
> 
> Kim

But you could send a "real" patch to the list. You have a great presentation
on the page above, but it doesn't do any of the people with commit access
any good if they have to spend an hour trying to apply your patch.

-jon


RE: Tomcat, JSP and Cache

Posted by Pilho Kim <ph...@math.soongsil.ac.kr>.
Hi,

Tomcat 3.x and 4.0 have a Cache-Control Bug.
But, none of Tomcat commiters know that.
Because I am not a commiter, I cannot fix the Bug of Tomcat.

Try to check my page:

    http://www.javaclue.org/tomcat/patch32/dopatch.html


Kim



On Wed, 6 Dec 2000, Paulo Gaspar wrote:

> That looks more like a browser/proxy issue.
> 
> Notice that:
>  - Internet Explorer often caches pages when it should NOT do it;
>  - Internet Explorer sometimes even uses a cache copy when you refresh;
>  - Some browsers ignore those meta tags.
>  - Proxies (usualy) ignore those meta tags.
> 
> Solutions I use:
>  - To control page caching I use HTTP headers;
>  - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
>    page doesn't look so good but caching and refresh realy work in a
>    predictable way.
> 
> For more info on caching issues and the relevant HTTP headers read...
> 
> Basics and HTTP headers:
>   http://www.netapp.com/products/netcache/cache_basics.html
> 
>   http://www.mnot.net/cache_docs/
>   or http://www.web-caching.com/mnot_tutorial/notes.html
> 
> THE web caching site:
>   http://www.web-caching.com/
> 
> On Proxy caches:
>   http://info.connect.com.au/docs/proxy/faq.html
> and, if you like RFCs:
>   http://www.faqs.org/rfcs/rfc2187.html
> 
> 
> Have fun,
> Paulo Gaspar
> 
> 
> > -----Original Message-----
> > From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> > Sent: Tuesday, December 05, 2000 15:15
> >
> >
> > I was wondering if anyone can help. I have tomcat server 3.1 running a
> > servlet and jsp page.
> > I have a servlet calling a jsp page with the redirect method. I've put the
> > required meta tags on the jsp page  so the page should not cache. However,
> > the page is still caching. In order for my page to display the proper
> > results I need to have my browser reload. Are there any setups
> > that need to
> > be done to Tomcat or do I need to have a web server running also????
> >
> > Thanks
> >
> > -----Original Message-----
> > From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> > Sent: Monday, December 04, 2000 3:49 PM
> > To: Adress, David S.; 'webmaster@jakarta.apache.org'
> > Subject: Re: Tomcat, JSP and Cache
> >
> >
> > Adress, David S. <Da...@pfizer.com> wrote:
> > >
> > > I was wondering if you can help.
> >
> > Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> > list. Check
> > out <http://jakarta.apache.org/mail.html>
> >
> >     Pier
> >
> > > I have tomcat server running a jsp page.
> > > I've put the required meta tags so the page should not cache.
> > However, the
> > > page is still caching. In order for my page to display the
> > proper results
> > I
> > > need to have my browser reload. Are there any setups that need
> > to be done
> > to
> > > Tomcat ???
> > >
> > > Thanks
> > >
> > --
> > Pier P. Fumagalli  Apache Software Foundation
> > <ma...@betaversion.org>
> > ------------------------------------------------------------------
> > ----------
> 
> 


RE: Tomcat, JSP and Cache

Posted by Pilho Kim <ph...@math.soongsil.ac.kr>.
Hi,

Tomcat 3.x and 4.0 have a Cache-Control Bug.
But, none of Tomcat commiters know that.
Because I am not a commiter, I cannot fix the Bug of Tomcat.

Try to check my page:

    http://www.javaclue.org/tomcat/patch32/dopatch.html


Kim



On Wed, 6 Dec 2000, Paulo Gaspar wrote:

> That looks more like a browser/proxy issue.
> 
> Notice that:
>  - Internet Explorer often caches pages when it should NOT do it;
>  - Internet Explorer sometimes even uses a cache copy when you refresh;
>  - Some browsers ignore those meta tags.
>  - Proxies (usualy) ignore those meta tags.
> 
> Solutions I use:
>  - To control page caching I use HTTP headers;
>  - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
>    page doesn't look so good but caching and refresh realy work in a
>    predictable way.
> 
> For more info on caching issues and the relevant HTTP headers read...
> 
> Basics and HTTP headers:
>   http://www.netapp.com/products/netcache/cache_basics.html
> 
>   http://www.mnot.net/cache_docs/
>   or http://www.web-caching.com/mnot_tutorial/notes.html
> 
> THE web caching site:
>   http://www.web-caching.com/
> 
> On Proxy caches:
>   http://info.connect.com.au/docs/proxy/faq.html
> and, if you like RFCs:
>   http://www.faqs.org/rfcs/rfc2187.html
> 
> 
> Have fun,
> Paulo Gaspar
> 
> 
> > -----Original Message-----
> > From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> > Sent: Tuesday, December 05, 2000 15:15
> >
> >
> > I was wondering if anyone can help. I have tomcat server 3.1 running a
> > servlet and jsp page.
> > I have a servlet calling a jsp page with the redirect method. I've put the
> > required meta tags on the jsp page  so the page should not cache. However,
> > the page is still caching. In order for my page to display the proper
> > results I need to have my browser reload. Are there any setups
> > that need to
> > be done to Tomcat or do I need to have a web server running also????
> >
> > Thanks
> >
> > -----Original Message-----
> > From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> > Sent: Monday, December 04, 2000 3:49 PM
> > To: Adress, David S.; 'webmaster@jakarta.apache.org'
> > Subject: Re: Tomcat, JSP and Cache
> >
> >
> > Adress, David S. <Da...@pfizer.com> wrote:
> > >
> > > I was wondering if you can help.
> >
> > Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> > list. Check
> > out <http://jakarta.apache.org/mail.html>
> >
> >     Pier
> >
> > > I have tomcat server running a jsp page.
> > > I've put the required meta tags so the page should not cache.
> > However, the
> > > page is still caching. In order for my page to display the
> > proper results
> > I
> > > need to have my browser reload. Are there any setups that need
> > to be done
> > to
> > > Tomcat ???
> > >
> > > Thanks
> > >
> > --
> > Pier P. Fumagalli  Apache Software Foundation
> > <ma...@betaversion.org>
> > ------------------------------------------------------------------
> > ----------
> 
> 


RE: Tomcat, JSP and Cache

Posted by Paulo Gaspar <pa...@krankikom.de>.
That looks more like a browser/proxy issue.

Notice that:
 - Internet Explorer often caches pages when it should NOT do it;
 - Internet Explorer sometimes even uses a cache copy when you refresh;
 - Some browsers ignore those meta tags.
 - Proxies (usualy) ignore those meta tags.

Solutions I use:
 - To control page caching I use HTTP headers;
 - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
   page doesn't look so good but caching and refresh realy work in a
   predictable way.

For more info on caching issues and the relevant HTTP headers read...

Basics and HTTP headers:
  http://www.netapp.com/products/netcache/cache_basics.html

  http://www.mnot.net/cache_docs/
  or http://www.web-caching.com/mnot_tutorial/notes.html

THE web caching site:
  http://www.web-caching.com/

On Proxy caches:
  http://info.connect.com.au/docs/proxy/faq.html
and, if you like RFCs:
  http://www.faqs.org/rfcs/rfc2187.html


Have fun,
Paulo Gaspar


> -----Original Message-----
> From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> Sent: Tuesday, December 05, 2000 15:15
>
>
> I was wondering if anyone can help. I have tomcat server 3.1 running a
> servlet and jsp page.
> I have a servlet calling a jsp page with the redirect method. I've put the
> required meta tags on the jsp page  so the page should not cache. However,
> the page is still caching. In order for my page to display the proper
> results I need to have my browser reload. Are there any setups
> that need to
> be done to Tomcat or do I need to have a web server running also????
>
> Thanks
>
> -----Original Message-----
> From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> Sent: Monday, December 04, 2000 3:49 PM
> To: Adress, David S.; 'webmaster@jakarta.apache.org'
> Subject: Re: Tomcat, JSP and Cache
>
>
> Adress, David S. <Da...@pfizer.com> wrote:
> >
> > I was wondering if you can help.
>
> Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> list. Check
> out <http://jakarta.apache.org/mail.html>
>
>     Pier
>
> > I have tomcat server running a jsp page.
> > I've put the required meta tags so the page should not cache.
> However, the
> > page is still caching. In order for my page to display the
> proper results
> I
> > need to have my browser reload. Are there any setups that need
> to be done
> to
> > Tomcat ???
> >
> > Thanks
> >
> --
> Pier P. Fumagalli  Apache Software Foundation
> <ma...@betaversion.org>
> ------------------------------------------------------------------
> ----------


RE: Tomcat, JSP and Cache

Posted by Paulo Gaspar <pa...@krankikom.de>.
That looks more like a browser/proxy issue.

Notice that:
 - Internet Explorer often caches pages when it should NOT do it;
 - Internet Explorer sometimes even uses a cache copy when you refresh;
 - Some browsers ignore those meta tags.
 - Proxies (usualy) ignore those meta tags.

Solutions I use:
 - To control page caching I use HTTP headers;
 - To avoid Internet Explorer caching issues I use Netscape 4.7x (the
   page doesn't look so good but caching and refresh realy work in a
   predictable way.

For more info on caching issues and the relevant HTTP headers read...

Basics and HTTP headers:
  http://www.netapp.com/products/netcache/cache_basics.html

  http://www.mnot.net/cache_docs/
  or http://www.web-caching.com/mnot_tutorial/notes.html

THE web caching site:
  http://www.web-caching.com/

On Proxy caches:
  http://info.connect.com.au/docs/proxy/faq.html
and, if you like RFCs:
  http://www.faqs.org/rfcs/rfc2187.html


Have fun,
Paulo Gaspar


> -----Original Message-----
> From: Adress, David S. [mailto:David.S.Adress@pfizer.com]
> Sent: Tuesday, December 05, 2000 15:15
>
>
> I was wondering if anyone can help. I have tomcat server 3.1 running a
> servlet and jsp page.
> I have a servlet calling a jsp page with the redirect method. I've put the
> required meta tags on the jsp page  so the page should not cache. However,
> the page is still caching. In order for my page to display the proper
> results I need to have my browser reload. Are there any setups
> that need to
> be done to Tomcat or do I need to have a web server running also????
>
> Thanks
>
> -----Original Message-----
> From: Pier P. Fumagalli [mailto:pier@betaversion.org]
> Sent: Monday, December 04, 2000 3:49 PM
> To: Adress, David S.; 'webmaster@jakarta.apache.org'
> Subject: Re: Tomcat, JSP and Cache
>
>
> Adress, David S. <Da...@pfizer.com> wrote:
> >
> > I was wondering if you can help.
>
> Nope, I'm sorry... You'd better contact the Tomcat USERS mailing
> list. Check
> out <http://jakarta.apache.org/mail.html>
>
>     Pier
>
> > I have tomcat server running a jsp page.
> > I've put the required meta tags so the page should not cache.
> However, the
> > page is still caching. In order for my page to display the
> proper results
> I
> > need to have my browser reload. Are there any setups that need
> to be done
> to
> > Tomcat ???
> >
> > Thanks
> >
> --
> Pier P. Fumagalli  Apache Software Foundation
> <ma...@betaversion.org>
> ------------------------------------------------------------------
> ----------