解决webSocket中使用@Autowired注入为空的办法

思路: 1、在启动类向webSocketServer中注入ApplicationContext 2、在你的webSocketServer类中通过ApplicationContext.getBean()中获取需要的bean类 注意,这里的eApplicationContext使用的是org.springframework.context.ApplicationContext包下的 然后在你需要使用的
相关文章
相关标签/搜索