java代码实现H5页面
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"); }
原理什么的后面整理,先把代码贴上