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>