会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Rolay
甘于平凡,做一个甘于平凡的人,菜米油盐,生老病死。
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
下一页
2019年8月7日
spring boot jar 方式后台发布
摘要: java -jar chat.jar >log_chat.file 2>&1 &
阅读全文
posted @ 2019-08-07 17:05 Rolay
阅读(196)
评论(0)
推荐(0)
2019年8月2日
spring boot中整合swagger2
摘要: 1、引入包 1 <dependency> 2 <groupId>io.springfox</groupId> 3 <artifactId>springfox-swagger2</artifactId> 4 <version>2.9.2</version> 5 </dependency> 6 <dep
阅读全文
posted @ 2019-08-02 10:54 Rolay
阅读(194)
评论(0)
推荐(0)
2019年8月1日
spring 中的RestTemplete
摘要: 最近在看spring cloud相关的书籍,在看到foreign的时候,看到了其内部是使用resttemplete实现的。于是对这个东西很好奇。去看了下里面的实现,就像发现了新大陆一般啊,原来还有这个玩意儿,还有这种神仙写法,为什么之前没有发现。 在之前我们要发起一个http请求,可能这样写: 1
阅读全文
posted @ 2019-08-01 15:54 Rolay
阅读(800)
评论(0)
推荐(0)
2019年7月31日
spring boot 中使用动态定时任务
摘要: 在实际开发过程中,可能需要定时任务在夜间对系统进行维护,但是如果cro表达式需要变更,通常我们都是写在方法上面,无法动态更改,如果需要修改则要修改源码重新打包发布。 1、新建一个空白的spring boot项目 2、在启动类上添加@EnableScheduling注解,启用定时任务。 3、新建定时任
阅读全文
posted @ 2019-07-31 13:49 Rolay
阅读(584)
评论(0)
推荐(0)
2019年7月29日
文件下载工具类
摘要: 1 @Component 2 public class DownLoadUtil { 3 /** 4 * 文件下载编码 5 * 该编码告诉浏览器文件名的编码方式,以防下载中文文件名时有乱码 6 */ 7 private static String encoding = "utf-8"; 8 9 /** ...
阅读全文
posted @ 2019-07-29 11:48 Rolay
阅读(439)
评论(0)
推荐(0)
spring boot 2.0+中整合redis 方法缓存Cache和普通缓存两种
摘要: 1、加入包 1 <dependency> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-starter-cache</artifactId> 4 </dependency> 5 <dependency>
阅读全文
posted @ 2019-07-29 10:54 Rolay
阅读(656)
评论(0)
推荐(0)
2019年7月26日
spring boot 2.0+ 整合RabbitMq
摘要: 1、添加包 1 <dependency> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-starter-amqp</artifactId> 4 </dependency> 2、配置文件 pring: #
阅读全文
posted @ 2019-07-26 09:58 Rolay
阅读(215)
评论(0)
推荐(0)
2019年7月24日
spring boot2.0+中添加全局异常捕获
摘要: 1、添加自定义异常,继承RuntimeException,为什么继承RuntimeException呢?是因为我们的事务在RuntimeException异常下会发生回滚。 1 public class BusinessException extends RuntimeException{ 2 3
阅读全文
posted @ 2019-07-24 12:29 Rolay
阅读(253)
评论(0)
推荐(0)
spring boot2.0+ 中配置log4j日志
摘要: 1、maven引入包,排除默认日志 2、添加配置文件,放到resources下,启动项目,就可以记录日志了,相关配置的修改可在配置文件中操作。 1 <?xml version="1.0" encoding="UTF-8"?> 2 <configuration> 3 <appenders> 4 <!-
阅读全文
posted @ 2019-07-24 12:24 Rolay
阅读(557)
评论(0)
推荐(0)
spring boot + websoket @ServerEndpoint中多个参数的写法
摘要: @ServerEndpoint(value="/websocket/{authcode}/{appid}/{uniqueid}")// websocket连接点映射.
阅读全文
posted @ 2019-07-24 11:56 Rolay
阅读(4609)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
下一页
公告