我的问题是如何在不使用javaScript的情况下从大气中的服务器推送数据
我按照聊天教程这是可以理解的,现在我想从struts 2中的一个动作推送数据(而不是来自javascript)我知道我必须调用.onMessage()
方法但是我被阻止了构建我试过的AtmosphereResponse
参数
AtmosphereResponse response = new AtmosphereResponse.Builder().build();
但是当我使用NullPointerExeption
methode
response.write()
非常感谢您的合作
答案 0 :(得分:1)
解决方案:BroadcasterFactory.getDefault().lookup("/atmosphere").broadcast(message);
"/atmosphere"
是您的AtmosphereServlet模式