I'm using Tomcat 6.0.20, HttpServlet
my servlet code are as followings :-
response.setContentType("ap开发者_运维百科plication/xml; charset=utf-8");
but each time i will got the content type as :
application/xml;charset=utf-8
which is without the space between " ; ".
May i know how to bypass the space being trimmed?
Is there anyway to do so (eg : modify the servet-api.jar)?
It could be happening in Tomcat, in a reverse proxy in front of Tomcat, in a proxy, a firewall or somewhere in the client-side stack. It is probably impossible to stop whatever is doing this.
But it should not matter. The HTTP standard says that there is optional whitespace after the semicolon. Your client-side code should work whether the space is present or not.
精彩评论