Michal Mosiewicz wrote:

> I was just wondering... in Tomcat's IncludedResponse I noticed that
> methods setting headers are not allowed. I briefly looked at specs, and
> have only found that target servlet is only allowed to write to output
> stream.
>
> This is basically very poor statement. It makes the efforts of W3C
> people that work hard to fit more data using less bits into the network.
>

>From the point of view of the HTTP protocol (i.e. the purview of the W3C
folks), the fact that you used RequestDispatcher.include() or <jsp:include> is
totally invisible -- it is all one response.  Included servlets and/or JSP
pages are about content (view in MVC terms), not modifying control (controller
in MVC terms).

>
> IMHO - included responses should also be able to influence headers.
> There are two possible approaches to this issue:
>
> a) response headers should be corrected in some cases - the best example
> here is a "Last-modified" header or cache control's max-age parameter.
> In case that content generated by the included servlet is fresher, this
> value should be corrected apropriately. If the included response is
> marked to have shorter validity period it influence the whole page and
> should be acommodated.
>

So what do you do if you've included three sub-servlets, and they all try to
set the "last modified" header?  Who is supposed to win?

>
> b) response headers should be returned - the source servlet should be
> able to examine the header values of the included response and adjust
> it's behaviour. It -- for example -- may use returned ETag to build it's
> own ETag value.
>
> This could be even more important in a distributed environment like
> Tomcat + Apache, where it could result in better, finer caching of
> documents and possibly subdocuments (i.e. included documents).
>

If you're talking about HTTP caching, that's done at the per-response
level (usually an HTML page).  The fact that multiple includes were used to
create that single response is totally invisible to your browser, and any
proxy server in between, so there's no possibility to cache the sub-component
responses anyway.

>
> -- Mike
>

Craig McClanahan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to