当前位置: 代码迷 >> Web前端 >> dwr 2.0兑现网页消息发送(配置文件)
  详细解决方案

dwr 2.0兑现网页消息发送(配置文件)

热度:327   发布时间:2012-11-22 00:16:41.0
dwr 2.0实现网页消息发送(配置文件)

web.xml配置dwr

<servlet>
??<servlet-name>dwr-invoker</servlet-name>
??<servlet-class>
???org.directwebremoting.servlet.DwrServlet
??</servlet-class>
??<init-param>
???<description>调试DWR,发布系统时应将其设为false</description>
???<param-name>debug</param-name>
???<param-value>true</param-value>
??</init-param>
??<init-param>
???<description>使用服务器推技术(反转AJAX)</description>
???<param-name>activeReverseAjaxEnabled</param-name>
???<param-value>true</param-value>
??</init-param>
??<init-param>
???<param-name>
????initApplicationScopeCreatorsAtStartup
???</param-name>
???<param-value>true</param-value>
??</init-param>
??<init-param>
???<param-name>maxWaitAfterWrite</param-name>
???<param-value>100</param-value>
??</init-param>
??<load-on-startup>4</load-on-startup>
?</servlet>
?<servlet-mapping>
??<servlet-name>dwr-invoker</servlet-name>
??<url-pattern>/dwr/*</url-pattern>
?</servlet-mapping>

?

dwr.xml

<dwr>
??? <allow>
??????? <convert converter="bean" match="com.dwrchat.User"/>
??????? <create creator="new" javascript="DWRChatManager">
??????????? <param name="class" value="com.dwrchat.ChatManager"/>
??????? </create>
??? </allow>
???
??
</dwr>

  相关解决方案