随笔分类 -  SpringMVC梳理

摘要:https://blog.csdn.net/ff906317011/article/details/78552426 阅读全文
posted @ 2021-01-28 10:33 Master_Sun 阅读(33) 评论(0) 推荐(0)
摘要:SpringMVC拦截器有许多应用场景,比如:登录认证拦截器,字符过滤拦截器,日志操作拦截器等等。 1、自定义拦截器 SpringMVC拦截器的实现一般有两种方式 1. 自定义的Interceptor类要实现了Spring的HandlerInterceptor接口。 2. 继承实现了HandlerI 阅读全文
posted @ 2021-01-27 16:15 Master_Sun 阅读(130) 评论(0) 推荐(0)
摘要:更详细:http://www.ruanyifeng.com/blog/2011/09/restful.html package com.xinzhi.controller; import com.alibaba.fastjson.JSONObject; import com.xinzhi.entit 阅读全文
posted @ 2021-01-27 12:28 Master_Sun 阅读(57) 评论(0) 推荐(0)
摘要:http://c.biancheng.net/view/4406.html https://blog.csdn.net/qq_28165595/article/details/76896354 @RequestMapping("/redirect") public String redirect() 阅读全文
posted @ 2021-01-27 10:56 Master_Sun 阅读(57) 评论(0) 推荐(0)
摘要:占坑 阅读全文
posted @ 2021-01-26 14:28 Master_Sun 阅读(44) 评论(0) 推荐(0)
摘要:占坑 阅读全文
posted @ 2021-01-26 14:27 Master_Sun 阅读(39) 评论(0) 推荐(0)
摘要:占坑 阅读全文
posted @ 2021-01-26 14:22 Master_Sun 阅读(113) 评论(0) 推荐(0)
摘要:pom.xml <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.8.sec10</version></dependency> 例子: 加上@ResponseBody, 阅读全文
posted @ 2021-01-26 13:56 Master_Sun 阅读(111) 评论(0) 推荐(0)
摘要:再也不用 getParamter 了 1. 建一个User类 package com.xinzhi.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; impor 阅读全文
posted @ 2021-01-25 22:49 Master_Sun 阅读(87) 评论(0) 推荐(0)
摘要:在 web.xml 中配置一个字符集过滤器即可 <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilt 阅读全文
posted @ 2021-01-25 22:00 Master_Sun 阅读(78) 评论(0) 推荐(0)
摘要:RequestMapping注解有六个属性 1、 value , method ; value: 指定请求的实际地址,指定的地址可以是URI Template 模式(后面将会说明); method: 指定请求的method类型, GET、POST、PUT、DELETE等; 2、 consumes , 阅读全文
posted @ 2021-01-25 21:56 Master_Sun 阅读(68) 评论(0) 推荐(0)
摘要:springmvc-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2 阅读全文
posted @ 2021-01-25 21:39 Master_Sun 阅读(61) 评论(0) 推荐(0)
摘要:package com.xinzhi.controller; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import java 阅读全文
posted @ 2021-01-25 21:26 Master_Sun 阅读(100) 评论(0) 推荐(0)
摘要:M 代表 模型(Model) 模型是什么呢? 模型就是数据,就是 dao,bean V 代表 视图(View) 视图是什么呢? 就是网页, JSP,用来展示模型中的数据 C 代表 控制器(controller) 控制器是什么? 控制器的作用就是把不同的数据(Model),显示在不同的视图 (View 阅读全文
posted @ 2021-01-24 16:08 Master_Sun 阅读(56) 评论(0) 推荐(0)