日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ajax mode,DWR的三种Reverse Ajax Mode配置详解

發布時間:2023/12/4 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ajax mode,DWR的三种Reverse Ajax Mode配置详解 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Full Streaming Mode

Early Closing Mode

Polling Mode

在DWR應用中.默認啟用的是Full Streaming Mode .它是三種modes中最快的一種.它每60秒檢查一次瀏覽器是否是活躍的.配置很簡單:

dwr-invokerorg.directwebremoting.servlet.DwrServletactiveReverseAjaxEnabledtrue

然后在要使用Reverse Ajax的頁面使用

dwr.engine.setActiveReverseAjax(true);

即可...在2.0.4以后的版本中還要加入

maxWaitAfterWrite-1

因為在2.0.4版本中默認是使用Early Closing Mode

Early Closing Mode:

在2.0.4以后的版本中不需要添加配置..而2.0.3以前的版本需要、添加

maxWaitAfterWrite500

If it is deemed unwise to hold connections open at all then DWR can use polling mode

org.directwebremoting.extend.ServerLoadMonitororg.directwebremoting.impl.PollingServerLoadMonitor

In polling mode the default poll rate is every 5 seconds. This can be customized using the following:

disconnectedTime60000

The example above will poll only once every 60 seconds (60,000 milliseconds). For many applications a response time of 60 seconds will be enough, and will allow a web server to handle a very large number of clients.

測試環境:IE8.0,Firefox 2.0,Windows xp sp2,Tomcat 6.0,MsSQL Server 2000

使用技術:Spring,Hibernate.Ext.DWR

用第一種配置的時候IE運行不了.報異常 "要完成操作的數據尚未準備好",Firefox可以.

第二種配置在maxWaitForWrite少于200的情況下IE運行正常,Firefox運行正常.

第三種配置只能打開一個連接.再想打開第二個則會報?? java.lang.IllegaStateException:Cannot create a session after response has been commited

很是郁悶...若將maxWaitForWrite設置為100.則兩個瀏覽器均沒問題..但是瀏覽器久無刷新動作就無法從服務器調用客戶端

這篇文章望拋磚引玉..各位講下你們是如何配置的

posted on 2008-06-15 01:30 phyeas 閱讀(988) 評論(1) ?編輯 ?收藏

總結

以上是生活随笔為你收集整理的ajax mode,DWR的三种Reverse Ajax Mode配置详解的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。