使用DWR完成消息推送
3.SendServlet.java
??4.Message.jsp
?5.配置web.xml
<servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <!-- 启用反向 --> <param-name>activeReverseAjaxEnabled</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> <servlet> <servlet-name>SendServlet</servlet-name> <servlet-class>com.bjpowernode.dwr.SendServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SendServlet</servlet-name> <url-pattern>/servlet/SendServlet</url-pattern> </servlet-mapping>?
?