---
title: "JDK6  HttpServer的使用"
author: "jl19861101"
date: "2009-11-11T10:38:00Z"
tags: []
slug: "jdk6-httpserver"
draft: false
lastmod: "2009-11-11T10:38:00Z"
id: 588448
url: "https://dbdxj.iteye.com/blog/588448"
---

[http://sunnylocus.iteye.com/blog/460945](http://sunnylocus.iteye.com/blog/460945)

返回有中文

不知道为什么exchange.sendResponseHeaders(200, 0);第二个参数设置为0就可以返回中文了。第二个参数设置为原有字符的长度的两倍，比如str.length()\*2返回中文的时候就可以显示出页面。