Why woud one attempt the set headers here. Since most of the tags are best positioned AFTER the form body would not they be too far into the rendered html to be set validly?
Technically you are right. There is a possibility that response is committed (internal response buffer is flushed) and after that header cannot be set to proper value. This may happen if you flushing response manually or on large pages (e.g. on Tomcat DEFAULT_BUFFER_SIZE = 8*1024, so you should have at least 8K of content before ajax: tag to make this happen).
As a temporary or optional solution we can make additional empty tag (something like ajax:headers or ajax:nocache) which can be placed on the top of the JSP, allowing HTTP response headers to be set properly.
Log in to post a comment.