![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring boot
文章平均质量分 55
xiuxiu_jun
这个作者很懒,什么都没留下…
展开
-
springboot RestTemplate 服务端之间http请求restful服务接口
RestTemplate使spring能够方便的使用rest资源,他定义了许多与rest交互分方法,并且对应大多数http请求方法。这里我使用exchange()方法完成请求。exchange() 是在URL上执行特定的HTTP方法,返回包含对象的ResponseEntity,这个对象是从响应体中映射得到的public class HttpConnectUtil { /** *...原创 2018-07-10 11:50:25 · 1921 阅读 · 0 评论 -
spring boot +websocket 服务器主动推送消息
WebSocket协议是基于TCP的一种新的网络协议。它实现了浏览器与服务器全双工(full-duplex)通信——允许服务器主动发送信息给客户端这里我将使用springboot2.0 集成的websocket 实现简单的服务器推送消息1.gradle添加依赖compile('org.springframework.boot:spring-boot-starter-websocket')2.配置...原创 2018-07-05 17:11:12 · 6444 阅读 · 4 评论 -
springboot RestTemplent 服务器上传文件
当我们项目中有独立的文件存储服务器时,难免会遇到其他的服务器在后台传送文件到文件存储服务器中。查过很多资料,可以说用RestTemplent来实现是最简单明了的。 //resource 需要上传的文件流//fileName 文件名//上传的服务地址//header 请求头。可以为nullpublic static ResponseEntity tempHttpFile(byte[...原创 2018-07-19 14:42:46 · 819 阅读 · 0 评论 -
modbus tcp通讯 modbus4j java实现
modbus协议内容网上已经很齐全了,这里就不赘述了。(此篇文章根据网上已有内容整理)核心依赖: modbus4j-3.0.4-SNAPSHOT.jar modbus tcp slave 1.获取tcp slave //springboot项目实现CommandLineRunner类和@Component注解,程序启动时就加载tcp slave@Componentpubli...原创 2018-07-31 13:57:06 · 25977 阅读 · 28 评论