tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <demablo...@gmail.com>
Subject Filter behaviour ( settinf Content-Length header )
Date Thu, 27 Feb 2014 08:18:31 GMT
Hello:

I'm using Tomcat 6.0.24 and I'm testing how to return Content-Length header
So I've defined a Filter and declared in web.xml of my web application

If I do this:

HttpServletResponse httpResponse = (HttpServletResponse) response;
chain.doFilter(request, response);
httpResponse.setHeader("Content-Length", "200");

doesn't work ( it doesn't set the header and
Transfer-Encoding:chunked is returned )
)

but

HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.setHeader("Content-Length", "200");
chain.doFilter(request, response);

does and it works OK

Why ?
Does anyone use a filter to set Content-Length header ?
Must I declared in web.xml of Tomcat ?


Regards

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


Mime
View raw message