springboot
蜗行牛步1024
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Springboot全局异常处理GlobalExceptionHandler
1. Springboot的全局异常查是通过两个注解@ControllerAdvice和@ExceptionHandler来实现的@ControllerAdvice:增强型控制器,对于控制器的全局配置放在同一个位置,全局异常的注解,放在类上。 @ControllerAdvice默认只会处理controller层抛出的异常,如果...原创 2018-09-30 09:39:54 · 23372 阅读 · 0 评论 -
SpringBoot 中使用 Servlet 开发
介绍:a. SpringBoot为我们自动配置了一个开箱即用的DispatcherServlet, 映射路径为"/";b. SpringBoot默认是不支持JSP的,所有想用JSP就必须使用外来的容器来运行,即不能使用嵌入的tomcat或jetty;c. 那么SpringBoot如何快速的支持Servlet呢?场景:a. 老项目使用JSP写的页面,后台用Servlet; 现在要改造为S...原创 2018-10-09 16:44:28 · 1141 阅读 · 0 评论 -
Springboot-shiro: This subject is anonymous - it does not have any identifying principals and
问题:spingboot 项目整合shiro 后, 通过注解 @RequirePermissions来进行权限控制 @ResponseBody @RequestMapping(value = "/detail", method = RequestMethod.POST) @RequiresPermissions("sys:msg:list") public...原创 2018-10-29 19:58:31 · 21793 阅读 · 6 评论 -
SpringBoot 多个拦截器配置
SpringBoot的拦截器实现和SpringMVC一致,通过配置把拦截器注入到Spring容器中去; 但配置方式不一样,完成代码如下:一、新建两个拦截器类package com.jd.m.tg.interceptor;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframewo...原创 2018-10-29 20:15:05 · 25608 阅读 · 0 评论 -
Springboot Logging的配置以及使用详解
Springboot使用Commons Logging作为内部的日志系统,并且给Java Util Logging,Log4J2以及Logback都提供了默认的配置。如果使用了spring boot的Starters,那么默认会使用Logback用于记录日志。一、Log formatspring boot中默认的日志输出格式如下:2014-03-05 10:57:51.112 I...原创 2018-10-30 15:22:39 · 10904 阅读 · 0 评论
分享