dwr3.0 ScriptSessionListener 在什么情况下调用sessionDestroyed销毁session? sessionCreated后 多长时间调用销毁? 销毁时间可配吗?
------解决方案--------------------
页面关闭或者session超时调用sessionDestroyed。
sessionCreated后如果一直有操作应该不会销毁。
可以在web.xml中配置session超时时间。
------解决方案--------------------
public synchronized void run() {
System.out.println(autoMessage);
Collection<ScriptSession> sessions = Browser
.getTargetSessions();
for (ScriptSession scriptSession : sessions) {
if (scriptSession.getPage().indexOf("dwrDemo") > 0) {
script.appendCall("appendRow1", autoMessage);
scriptSession.addScript(script);
} else {
continue;
}
}
}
------解决方案--------------------
记得写runnable的run方法