赞
踩
DWR技术是基于AJAX的,在我的理解里,它也算是ajax的一种变形,实现了java 和javascript 之间的一种实时通信。
准备工作:
1.dwr的相关jar包,这里我用的是dwr3.0. 还有dwr依赖的包:Commons Logging jar
2.配置Dwr,在web.xml里面添加dwr的支持:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>DwrDemo</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.directwebremoting.servlet.DwrListener</listener-class>
</listener>
<servlet>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。