原文:http://www.jb51.cc/article/p-agnurwdi-pp.html
DWR高级主题之反向Ajax(DWR3的轮询模式演示1)
----------web.xml
- <?xmlversion="1.0"encoding="UTF-8"?>
- <web-appxmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
- display-name>firstDWR</welcome-file-listwelcome-file>index.html>
- <!--TheDWRServlet...-->
- servlet>DWRServletservlet-name>dwr-invokerservlet-class>org.directwebremoting.servlet.DwrServlet <!--初始化参数,增加调试功能-->
- init-paramparam-name>debugparam-value>true<!--跨域调用配置信息,不是必须的-->
- >crossDomainSessionSecurity>false<!--下面是轮询模式的反向Ajax所需要的参数-->
- >activeReverseAjaxEnabled>org.directwebremoting.extend.ServerLoadMonitor>org.directwebremoting.impl.PollingServerLoadMonitor<!--设置轮询的频率为6秒-->
- >disconnectedTime>6000servlet-mappingurl-pattern>/dwr/*
- web-app>
dwr.xml
copy