You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Laura Werner <la...@lwerner.org> on 2003/03/10 22:31:14 UTC

Sending custom Date header from servlet?

I'm trying to write a servlet that sends Date and Expires headers that 
are a few days in the past.  (It's the server side of a caching test 
case.)  Adding the old Expires header is trivial:
    response.setDateHeader("Expires", System.currentTimeMillis() - 3 * 
ONE_DAY);
but if I put in the identical code with "Date" instead of "Expires", 
nothing seems to happen.  I still get a Date header that's set to the 
actual request time.

I've poked around a little bit in the Catalina code, and I can't figure 
out why this would be happening.  There's code in HttpProcessor that 
adds a Date header right before calling 
connector.getContainer().invoke(), but since my servlet code runs after 
that, I think it should override this default value.

Does anyone have advice on this, or see anything I'm missing?

Thanks!

Laura Werner
BeVocal, Inc.

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