package com.tomlin.tomcat.handle; import java.io.IOException; import java.io.OutputStream; /** * @Author: tomlin * @Description: 处理response 响应 * @ClassName: MyResponse * @Date: 2018/10/1 11:35 * @Version: 1.0 */ public class MyResponse { //创建字节输出 private OutputStream outputStream; public MyResponse(OutputStream outputStream){ this.outputStream = outputStream; } public void write(String content) throws IOException { /*HHTP响应协议*/ //HTTP/1.1 200 OK //Bdpagetype: 1 //Bdqid: 0x8714daec00013b42 //Cache-Control: private //Connection: Keep-Alive //响应一个网页元素 //<html><body</body></html> StringBuffer httpResponse = new StringBuffer(); httpResponse.append("HTTP/1.1 200 OK\n") .append("Content-type: text/html\n") .append("\r\n") .append("<html><body>") .append(content) .append("</body></html>"); //写出响应资源 outputStream.write(httpResponse.toString().getBytes()); outputStream.close();//关闭流 } }

xun9er LV1
2023年3月18日
lironggang LV38
2021年6月16日
1316463958 LV8
2019年10月14日
ly3812 LV17
2019年10月2日
陆地火箭 LV3
2019年7月10日
ljkfdsjh LV2
2019年4月10日
二两小面加个蛋 LV10
2019年3月6日
pdd LV2
2019年2月14日
myzczx LV25
2019年2月9日
xinjames LV27
2019年2月5日

lee123321 LV22
2023年12月19日
annazhang LV29
2023年10月3日
xun9er LV1
2023年3月18日
al-aaalll LV3
2022年12月13日
xsxtxbb LV8
2022年10月10日
tomcat_test LV2
2022年7月6日
isfrand LV4
2022年4月18日
3188681084 LV1
2022年3月24日
李润石 LV2
2022年1月18日
lironggang LV38
2021年6月16日