tangou

2018年2月8日

如何在SpringBoot项目中使用拦截器

摘要: 相比springmvc,springboot中拦截器不需要在xml中配置,只需定义拦截器类 implements HandlerInterceptor 和拦截器拦截路径的配置类extends WebMvcConfigurerAdapter 1.SessionInterceptor 2.Session 阅读全文

posted @ 2018-02-08 17:01 tangou 阅读(12727) 评论(0) 推荐(0)

springboot练习

摘要: https://www.jianshu.com/p/9a08417e4e84 1.@Controller和@RestController的区别? Spring4之后加入的注解,原来在@Controller中返回json需要@ResponseBody来配合,如果直接用@RestController替代 阅读全文

posted @ 2018-02-08 15:38 tangou 阅读(268) 评论(0) 推荐(0)

使用Druid作为SpringBoot项目数据源(添加监控)

摘要: Druid是一个关系型数据库连接池,它是阿里巴巴的一个开源项目。Druid支持所有JDBC兼容数据库,包括了Oracle、MySQL、PostgreSQL、SQL Server、H2等。Druid在监控、可扩展性、稳定性和性能方面具有明显的优势。通过Druid提供的监控功能,可以实时观察数据库连接池 阅读全文

posted @ 2018-02-08 15:35 tangou 阅读(510) 评论(0) 推荐(0)

导航