Java-SpringMvc-响应Html代码展示
代码
@RequestMapping(value = "/test.do", method = {RequestMethod.GET}) public void test(HttpServletResponse response) { response.setContentType("text/html;charset=utf-8"); PrintWriter out= null; try { out = response.getWriter(); } catch (IOException e) { e.printStackTrace(); } out.println("<div style='width:600px;height:600px;border:1px solid red;'>我是模板信息</div>"); }