jdk1.7 Tomcat8.5,自定义WsHandler用不了,action使用插件里面的msg2room就可以完成通讯。请帮忙看一下是什么问题,代码片段如下:
@ServerEndpoint(value = "/m/websocket/ws",configurator = NutWsConfigurator.class)
@IocBean
public class MyWebSocket extends AbstractWsEndpoint {
@Inject Dao dao;
public WsHandler createrHandler(){
return new MySimpleWsHandler();
}
}
//自定义wshandler
public class MySimpleWsHandler extends SimpleWsHandler implements MessageHandler.Whole<String> {
public MySimpleWsHandler() {
super("");
}
public void msgRoom(final NutMap req) {
System.out.println("----------------msgRoom...");
String room = req.getString("room");
System.out.println("--------------room:" + room);
msg2room(req);
}