/* 点击爆炸效果*/

websocket 404 close

1.今天遇到个websocket服务端连接404问题,依赖什么的都没什么问题,然后一直不行

2.网上说的加

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

一直报错No 'javax.websocket.server.ServerContainer' ServletContext attribute - Glassfish 4.1

2.原因是因为

spring-boot-starter-parent 版本问题2.0之前

server:
context-path: /sale_sys
port: 9000

2.0之后

 

server:
port: 9000
servlet:
session:
timeout: 10000
context-path: /sale_sys


我的404是因为ws://localhost:9000/sale_sys/websocket/"+userno websocket没有加项目名称

 

posted @ 2020-06-01 10:03  tom的猫  阅读(302)  评论(0编辑  收藏  举报