.atitit.web 推送實現解決方案集合(3)----dwr3 Reverse Ajax

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   ar   java   for   sp   

.atitit.web 推送實現解決方案集合(3)----dwr3 Reverse Ajax

1. 原理實現 1

2. Page  增加配置,增加回呼函數dwr.engine.setActiveReverseAjax(true); 1

3. Web.xml增加配置 1

4. Java代碼(page法,簡單) 2

5. 推薦實現方式 attribute法。。 2

6. 參考::: 2

 

1. 原理實現

 

ScriptSession ::簡單的一個page url管理一個scriptsession,這個dept蘭。。

attribute法::: 一個page可以多個sess,這個推薦。。

2. Page  增加配置,增加回呼函數dwr.engine.setActiveReverseAjax(true);

 

作者:: 老哇的爪子 Attilax 艾龍,  EMAIL:[email protected]

轉載請註明來源: http://blog.csdn.net/attilax

 

 

3. Web.xml增加配置

 

   <init-param>

    <param-name>activeReverseAjaxEnabled</param-name>

    <param-value>true</param-value>

  </init-param>

  <init-param>

  <param-name>org.directwebremoting.extend.ServerLoadMonitor</param-name>

  <param-value>org.directwebremoting.impl.PollingServerLoadMonitor</param-value>

</init-param>

 <!-- timer time  -->

<init-param>

  <param-name>disconnectedTime</param-name>

  <param-value>1000</param-value>

</init-param>

 

4. Java代碼(page法,簡單)

public static void pushJs(String js_str) {

js_str=js_str.replace("/elfinder-2.0-rc1/php/../../", "");

// attilax 老哇的爪子 1_u_8 o0c

Collection<ScriptSession> sesses = ServerContextFactory.get().getScriptSessionsByPage("/vod/elemt/elemt_edit.jsp");

// Util util=new Util(sesses);

for (ScriptSession scriptSession : sesses) {

String script = js_str;// "recvFilepath(‘aaaa‘);";

scriptSession.addScript(new ScriptBuffer(script));

}

}

//e

 

5. 推薦實現方式 attribute法。。

參考官方文檔。。

6. 參考:::

 

Dwr的Reverse Ajax初步技術實現 - 它山之石,可以攻玉 - 部落格頻道 - CSDN.NET.htm

dwr 後台推送技術 - is_zhoufeng的專欄 - 部落格頻道 - CSDN.NET

dwr3實現訊息精確推送詳細步驟 - 少年阿賓 - BlogJava

DWR Reverse Ajax功能實踐的要點 - 我愛佳娃 - BlogJava

Dwr website (detail zeush)  recomm

.atitit.web 推送實現解決方案集合(3)----dwr3 Reverse Ajax

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.