Environment: Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode),tomcat6
When I use HttpServlet to send a html page,like this:
resp.getWriter().append(body);//"body" is a html file content,and has some \n at first
resp.addHeader(name, value);
When the codes run on Linux,the http client can not get the header that I added,but run on Windows7 it can.
I exchange order the codes,like this:
resp.addHeader(name, value);
resp.getWriter().append(body);//"body" is a html file content
then it's ok both on linux and windows.
This is why?