websocket+线程轮询:后台使用线程定时查询数据库变动数据,若有变动将用websocket实时推送消息到前台页面显示
https://
账号
密码
IntelliJ IDEA 2019.3 x64
jdk1.8
tomcat85_8090
项目 右键》Maven》Update Project...(Alt+F5)
- spring.datasource.url=修改数据库信息,ip、数据库名;
- server.port=IDEA启动项目/浏览器访问项目地址中的端口号8090
- server.servlet.context-path=/启动项目名称
SpringBoot项目的主配置文件ChartApplication.java》点击按钮Debug
SpringBoot项目在启动后,首先会去静态资源路径(resources/static/)下查找 index.html 作为首页文件。
如果在静态资源路径(resources/static/)下找不到 index.html,则会到(resources/templates/)目录下找 index.html(使用 Thymeleaf 模版)作为首页文件。
http://localhost:8090/thymeleaf_charts_websocket_jpa/
192.168.21.120
root
123456
/opt/developsoft/servers/tomcat/tomcat85_8090
(1)ps -ef | grep thymeleaf_charts_websocket_jpa.jar查出进程号,kill -9 进程号;
(2)替换jar;
(3)./startup.sh 启动
http://192.168.21.120:8090/thymeleaf_charts_websocket_jpa
http://
账号
密码