@Inject
protected MyWebsocket myWebsocket;
@Inject
protected ServiceDao serviceDao
@at
@ok(“void”)
public void list() {
myWebsocket.sendJson(serviceDao .findlist());
}
});
}
14 回复
@Inject
MySocket mySocket;
@At("/hello")
@Ok("jsp:/index1.jsp")
public void hello(Session session) {
QueryResult findlist = serviceDao.findlist(1);
mySocket.sendJson(session.getId(),findlist);
}
两者的关联关系,要在websocket的OnOpen事件内关联起来的
https://github.com/nutzam/nutzmore/commit/1189ebc6103eec02b40e3203690a0f47aec73664
添加回复
请先登陆