public void getH5(HttpServletResponse response){ StringBuffer res=new StringBuffer(); res.append("<!Doctype html>"); res.append("<html lang='zh-cn'>"); res.append("<head><mate charset='utf-8'/><title>這是標題欄</title></head><body>"); StringBuffer stringBuffer=new StringBuffer(); stringBuffer.append("這是body中的內容內容"); res.append(stringBuffer.toString()); res.append("</body></html>"); response.addHeader("content-type","text/html; charset=utf-8"); }
原理什么的后面整理,先把代碼貼上