tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yun Sang Jung" <>
Subject Re: Could you advice me to correct my custom tag code?
Date Wed, 02 Aug 2000 02:12:22 GMT
width="1" height="1">
Thank you for quick response and I'm sorry for not full description.

> * In what way does this "not work properly"?  Is the problem that the
>   headers are not getting generated, or that they are getting generated
>   but the page is still cached?

My problem was that page seemed to be still cached!
After I loaded nocached page(nocache.jsp) and moved other page, I clicked browser's
back button. I expected browser to complain with following message "this page is expired..
if you want to get page, click reload button" but there is no warning message when I clicked
back button.

Now, receiving your notice, I checked the apache access.log file instead of expecting warning
message. I exchanged my code according to your advice. "res.addDateHeader("Expires", 1);"

When I clicked back button without my nocache custom tag, there was no apache log and 
browser displayed the page properly.(maybe cached local machine)

When I clicked back button with my nocache custom tag, there was apache access log and
browser displayed the page properly.(maybe it works?)

At this point, I thnk my assumption was wrong.
It seems that nocache tag works fine.

> * To answer the question above, you might need to use some sort of
>   debugging tool that lets you look at the actual headers received
>   (by the client) as part of the response.

Is there tools to recommend to me?

> * If this custom tag occurs in your page at a point such that the
>   output response has been committed already (in other words,
>   the first buffer-full of data has been sent), any later attempt to
>   set HTTP headers will be ignored.  To avoid this, be sure that
>   you specify a buffer size in the <%@ page %> directive big
>   enough to ensure that this does not happen.

I'll seriously consider above thing in developing my apps.

> * I'm not sure you really need to go to the effort of checking which
>   protocol the request came in with.  I tend to write all three of the
>   following headers in my code when I want to defeat caching:
>         res.addHeader("Pragma", "No-cache");
>         res.addHeader("Cache-Control", "no-cache");
>         res.addDateHeader("Expires", 1);
> * Note that the expires header uses one instead of zero.  I have
>   heard that some browsers have a problem respecting the value
>   created by a zero date header.
> Craig McClanahan
> ========================================

Thanks Craig.



View raw message