关于servlet中response的sethead跟addhead

关于servlet中response的sethead和addheadresponse.sethead(name,liudehua1)response.addhead(name

关于servlet中response的sethead和addhead
response.sethead("name","liudehua1");
response.addhead("name","liudehua2");
response.sethead("name","liudehua3");

第三行代码,会把前面两个name都替换掉,还是只会替换掉其中的一个呢。
[解决办法]
自己写一个servlet测试以下。

URL url = new URL("http://localhost:8080/apps/Servlet/Test");
URLConnection uc = url.openConnection();
Map<String, List<String>> headers = uc.getHeaderFields();
System.out.println(headers);
一目了然了。
[解决办法]
自己写代码试一下