上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 110 下一页
摘要: 返回自定义异常界面,需要引入thymeleaf依赖(非必须,如果是简单的html界面则不用) <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</art 阅读全文
posted @ 2020-07-05 10:58 陈彦斌 阅读(1070) 评论(0) 推荐(0)
摘要: 全局异常处理 为什么要配全局异常? 不配全局服务端报错场景,1/0、空指针等 配置好处 统一的错误页面或错误码 对用户更友好 配置全局异常 第一步类添加注解 @ControllerAdvicce,如果需要返回JSON数据,则方法需要加@ReponseBody @RestControllerAdvic 阅读全文
posted @ 2020-07-05 10:19 陈彦斌 阅读(1215) 评论(0) 推荐(0)
摘要: 引入相关依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <ex 阅读全文
posted @ 2020-07-04 22:36 陈彦斌 阅读(247) 评论(0) 推荐(0)
摘要: 配置文件加载 方式一 Controller上面配置@PropertySource({"classpath:pay.properties"}) 添加属性@Value("wxpay.appid") private String payAppid; pay.properties # 微信支付的appid 阅读全文
posted @ 2020-07-04 22:07 陈彦斌 阅读(1687) 评论(0) 推荐(1)
摘要: 什么是热部署 应用正在运行的时候升级功能,不需要重新启动应用 对于Java应用程序来说,热部署就是在运行时更新Java类文件 好处:不需要重新手工启动应用,提高本地开发效率 常见热部署 jrebel Spring Loaded spring-boot-devtools 步骤 pom文件添加依赖包 < 阅读全文
posted @ 2020-07-04 14:02 陈彦斌 阅读(228) 评论(0) 推荐(0)
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 110 下一页