随笔分类 - SpringMVC
摘要:需求:controller返回浏览器会渲染的html页面字符串 1.实现方式一 直接通过HttpServletResponse以流的方式将html字符串写到浏览器页面,注意设置Header,标志让浏览器以html方式处理。 PrintWriter pw =null; response.setHead
阅读全文
摘要:Springmvc 通过return "redirect:" 实现重定向 重定向的状态码301 302 301,302 都是HTTP状态的编码,都代表着某个URL发生了转移,不同之处在于: 301 redirect: 301 代表永久性转移(Permanently Moved)。 302 redir
阅读全文
摘要:一:@RequestBody和@RequestParam区别 @RequestParam用来处理Content-Type: 为 application/x-www-form-urlencoded编码的内容。(Http协议中,如果不指定Content-Type,则默认传递的参数就是applicatio
阅读全文