上一篇文章我们没有使用Spring MVC,而是自己编写了一个Servlet用来处理来自的客户端的WebSocket连接,这篇文章我们用Spring MVC + WebSocket改造下之前的程序。
pom.xml增加spring-mvc的依赖:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframewor