2019年5月27日

(入门SpringBoot)SpringBoot加接口操作日志好方法(九)

摘要: 用Spring的切面去做,慕课网上的大神的小妙招,被我拷贝下来了。import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.*; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils;... 阅读全文

posted @ 2019-05-27 22:36 六一儿童节 阅读(431) 评论(0) 推荐(0) 编辑

(入门SpringBoot)SpringBoot后台验证(八)

摘要: 后台验证的作用主要是防止postman...等等工具的恶意提交,前后台都判断数据,双保险. 阅读全文

posted @ 2019-05-27 22:33 六一儿童节 阅读(487) 评论(0) 推荐(0) 编辑

(入门SpringBoot)SpringBoot结合拦截器(七)

摘要: SpringBoot拦截器: @Componentpublic class MyInterceptor implements HandlerInterceptor { /** * preHandle:在业务处理器处理请求之前被调用。预处理,可以进行编码、安全控制、权限校验等处理; * @param 阅读全文

posted @ 2019-05-27 22:14 六一儿童节 阅读(257) 评论(0) 推荐(0) 编辑

(入门SpringBoot)SpringBoot结合logback(六)

摘要: SpringBoot结合logback日志: 1.配置资源文件: #日志配置信息logbacklogging.config=classpath:logback-spring.xmllog.path=E/logs #存放路径log.level=info #日志等级log.name=demo_proje 阅读全文

posted @ 2019-05-27 21:26 六一儿童节 阅读(270) 评论(0) 推荐(0) 编辑

(入门SpringBoot)SpringBoot配置全局异常(五)

摘要: Spring的全局异常,用于捕获程序员没有捕获的异常。具体请看下面代码: 1.ControllerAdvice拦截异常,统一处理.通过Spring的AOP来管理. @ControllerAdvicepublic class ExceptionHandle { /** * 要捕获什么异常: * @re 阅读全文

posted @ 2019-05-27 06:11 六一儿童节 阅读(375) 评论(0) 推荐(0) 编辑

导航