![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
Torey_Li
本博客主要要来记录学习的课程以及工作中遇到的问题,积累技术,锤炼思维,认识更多的朋友
展开
-
1 SpringBoot配置全局的异常捕获-web页面跳转
1 在src/main/java/com/imooc 新建exception包,在该包下新建MyExceptionHandler.java内容如下: package com.imooc.contoller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation...原创 2019-04-01 06:07:37 · 694 阅读 · 0 评论 -
2 SpringBoot配置全局的异常捕获-ajax形式
1 在src/main/java/com/imooc 新建exception包,在该包下新建AjaxExceptionHandler.java内容如下: package com.imooc.exception; import com.imooc.pojo.JSONResult; import org.springframework.web.bind.annotation.ExceptionHand...原创 2019-04-01 05:59:36 · 321 阅读 · 0 评论 -
3 Spring Boot配置全局的异常捕获 - 同时兼容web与ajax
package com.imooc.exception; import com.imooc.pojo.JSONResult; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; im...原创 2019-04-01 06:02:05 · 199 阅读 · 0 评论 -
springBoot 获取配置文件里的值
通过spring容器获取环境变量 package com.boot.config.bootconfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework....原创 2019-05-11 08:24:50 · 1067 阅读 · 0 评论