Hi, Mark Thanks for your patient help. I have figured out the problem. It's not relevant to Tomcat.
I tested my web application from NetBeans IDE with HTTP monitor enabled, NetBeans put a wrapper on the Tomcat's response object. I think that wrapper caused the problem. Thanks Best Regards Stephen