![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot分类
achieve-mr.j
这个作者很懒,什么都没留下…
展开
-
springboot解决前台string类型时间后台date类型接收问题
1、在接收参数的controller中加入: @InitBinder public void initBinder(WebDataBinder binder) { //binder.setDisallowedFields("name"); CustomDateEditor editor = new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"),true); binder.registerCustomEditor(Date.cl原创 2020-07-30 11:19:19 · 1313 阅读 · 0 评论 -
SpringBoot学习之添加fastjson的方式及处理中文乱码
SpringBoot中使用FastJson有两种方式。 处理中文乱码添加代码 List fastMediaTypes = new ArrayList<>(); fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8); fastConverter.setSupportedMediaTypes(fastMediaTypes); 1,启动类继承...原创 2019-09-18 19:05:09 · 419 阅读 · 0 评论 -
SpringBoot学习之全局异常处理
全局异常处理,省去各种Try/Catch 暂时举例返回字符串 1、项目包下创建 GlobalDefaultExceptionHandler 类 2、在class注解上@ControllerAdvice 3、在方法上注解上@ExceptionHandler(value = Exception.class) @ControllerAdvice public class GlobalDefaultExc...原创 2019-09-20 15:11:38 · 74 阅读 · 0 评论 -
springboot学习之注解
各种注解可能会用,但是不知道为什么,必须做一整理 @SpringBootApplication 组合注解 包含@EnableAutoConfiguration、@ComponentScan和@SpringBootConfiguration三个注解,标注为springboot启动类 @Resource 自...原创 2019-09-26 18:59:24 · 100 阅读 · 0 评论 -
springboot学习之模板文件thymeleaf
添加thymeleaf模板 1、pom.xml <!--thymeleaf依赖包--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> ...原创 2019-09-27 16:43:56 · 115 阅读 · 0 评论