You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by rf <ru...@yahoo.com> on 2003/03/14 07:27:43 UTC

Problem with default servlet

Hello
I am using a caching Filter that *conditionally* uses
the default servlet (through RequestDispatcher) to
serve a page, or generate it again. In the case when
the default servlet is used to serve the page, this
servlet seems to send the headers Last-modified and
ETag, and this seems to have an effect on IE which, on
a shift-refresh, does not seem to request the page
again at all. (IE, by default, is set to check for
newer versions of stored pages 'Automatically').

1. Is the IE behaviour due to those two headers?
2. If yes, how can I instruct the default servlet not
send these headers?
3. Sending these headers is good, but I thought IE
would send the request, nevertheless, with the
If-none-matched and If-Modified-Since. Is this
something wrong with IE?

Thanks
~rf

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem with default servlet

Posted by rf <ru...@yahoo.com>.
Anyone has any further comments on this?


--- rf <ru...@yahoo.com> wrote:
> 
> --- Bill Barker <wb...@wilshire.com> wrote:
> > 
> > "rf" <ru...@yahoo.com> wrote in message
> >
>
news:20030314062743.86331.qmail@web13207.mail.yahoo.com...
> > > Hello
> > > I am using a caching Filter that *conditionally*
> > uses
> > > the default servlet (through RequestDispatcher)
> to
> > > serve a page, or generate it again. In the case
> > when
> > > the default servlet is used to serve the page,
> > this
> > > servlet seems to send the headers Last-modified
> > and
> > > ETag, and this seems to have an effect on IE
> > which, on
> > > a shift-refresh, does not seem to request the
> page
> > > again at all. (IE, by default, is set to check
> for
> > > newer versions of stored pages 'Automatically').
> > >
> > > 1. Is the IE behaviour due to those two headers?
> > Yes. (or, more generally, a browser won't fetch a
> > non-updated page that
> > includes a Last-Modified header when the page
> hasn't
> > changed).
> > 
> > > 2. If yes, how can I instruct the default
> servlet
> > not
> > > send these headers?
> > 
> > You can't.
> > 
> > > 3. Sending these headers is good, but I thought
> IE
> > > would send the request, nevertheless, with the
> > > If-none-matched and If-Modified-Since. Is this
> > > something wrong with IE?
> > 
> > IE should send a If-Modified-Since (and get a '304
> > Not Modified' response).
> > Otherwise, you will have to take it up with Bill
> > Gates ;-).
> 
> 1. Are you sure? This is a critical issue - I am
> sure
> there must have been discussions on this in the
> past.
> This surely must have troubled a lot of people.
> 
> 2. HttpServlet interface has a getLastModfied
> method.
>  Which is better/recommended:
>   A. Use a filter that caches the output and use the
>   default servlet to serve that next time
>   OR 
>   B. Use only a servlet with a getLastModified
> method
>    and put Last-Modified and ETag headers myself.
> 
> For A, I have the problem as mentioned earlier (IE
> not
> sending the request at all).
> I have not yet tested B, but do all the browsers use
> the If-None-Match and If-Modified-Since headers? In
> case
> the browsers do not send that, tomcat will not use
> the
> getlastModified method of the servlet(or does it?)
> and
> I dont get what I want.
> 
> Thanks
> ~rf
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem with default servlet

Posted by rf <ru...@yahoo.com>.
--- Bill Barker <wb...@wilshire.com> wrote:
> 
> "rf" <ru...@yahoo.com> wrote in message
>
news:20030314062743.86331.qmail@web13207.mail.yahoo.com...
> > Hello
> > I am using a caching Filter that *conditionally*
> uses
> > the default servlet (through RequestDispatcher) to
> > serve a page, or generate it again. In the case
> when
> > the default servlet is used to serve the page,
> this
> > servlet seems to send the headers Last-modified
> and
> > ETag, and this seems to have an effect on IE
> which, on
> > a shift-refresh, does not seem to request the page
> > again at all. (IE, by default, is set to check for
> > newer versions of stored pages 'Automatically').
> >
> > 1. Is the IE behaviour due to those two headers?
> Yes. (or, more generally, a browser won't fetch a
> non-updated page that
> includes a Last-Modified header when the page hasn't
> changed).
> 
> > 2. If yes, how can I instruct the default servlet
> not
> > send these headers?
> 
> You can't.
> 
> > 3. Sending these headers is good, but I thought IE
> > would send the request, nevertheless, with the
> > If-none-matched and If-Modified-Since. Is this
> > something wrong with IE?
> 
> IE should send a If-Modified-Since (and get a '304
> Not Modified' response).
> Otherwise, you will have to take it up with Bill
> Gates ;-).

1. Are you sure? This is a critical issue - I am sure
there must have been discussions on this in the past.
This surely must have troubled a lot of people.

2. HttpServlet interface has a getLastModfied method.
 Which is better/recommended:
  A. Use a filter that caches the output and use the
  default servlet to serve that next time
  OR 
  B. Use only a servlet with a getLastModified method
   and put Last-Modified and ETag headers myself.

For A, I have the problem as mentioned earlier (IE not
sending the request at all).
I have not yet tested B, but do all the browsers use
the If-None-Match and If-Modified-Since headers? In
case
the browsers do not send that, tomcat will not use the
getlastModified method of the servlet(or does it?) and
I dont get what I want.

Thanks
~rf


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem with default servlet

Posted by Bill Barker <wb...@wilshire.com>.
"rf" <ru...@yahoo.com> wrote in message
news:20030314062743.86331.qmail@web13207.mail.yahoo.com...
> Hello
> I am using a caching Filter that *conditionally* uses
> the default servlet (through RequestDispatcher) to
> serve a page, or generate it again. In the case when
> the default servlet is used to serve the page, this
> servlet seems to send the headers Last-modified and
> ETag, and this seems to have an effect on IE which, on
> a shift-refresh, does not seem to request the page
> again at all. (IE, by default, is set to check for
> newer versions of stored pages 'Automatically').
>
> 1. Is the IE behaviour due to those two headers?
Yes. (or, more generally, a browser won't fetch a non-updated page that
includes a Last-Modified header when the page hasn't changed).

> 2. If yes, how can I instruct the default servlet not
> send these headers?

You can't.

> 3. Sending these headers is good, but I thought IE
> would send the request, nevertheless, with the
> If-none-matched and If-Modified-Since. Is this
> something wrong with IE?

IE should send a If-Modified-Since (and get a '304 Not Modified' response).
Otherwise, you will have to take it up with Bill Gates ;-).

>
> Thanks
> ~rf
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org