js中开启dwr推功能
在window.onload中使用dwr.engine.setActiveReverseAjax(true);
在window.onload中使用dwr.engine.setActiveReverseAjax(true);

出来混,谁不都要拼命的嘛。 。拼不赢?那就看谁倒霉了。 。有机会也要看谁下手快,快的就能赢,慢。 。狗屎你都抢不到。 。还说什么拼命?
程序代码:Browser.withAllSessionsFiltered(new ScriptSessionFilter() {
public boolean match(ScriptSession session) {
Long loginUserId = (Long) session.getAttribute(Constant.LG_USER_ID);
if(loginUserId!=null && targetIdList.contains(loginUserId))
{
targetIdList.remove(loginUserId);//如果找到了,说明将被推送,所以不用再处理,剩下的都是要被处理的
return true;
}
return false;
}
}, new Runnable() {
private ScriptBuffer script = new ScriptBuffer();
public void run()
{
script.appendCall("这里写你页面的js函数", 这个参数是传给js函数的);
Collection<ScriptSession> sessions = Browser.getTargetSessions();
for (ScriptSession scriptSession : sessions)
{
scriptSession.addScript(script);
}
//ScriptSessions.addFunctionCall("ExtTalk.updateMegGroup", data);//之所以不用这个方法,是因为这个
//方法有bug的存在,会对所有不论过不过滤的scriptsession进行推送,相当于全推送,没有起到过滤的作用
}
});
