DWR2.0.5版本结合spring2.5.5
官方参考文档http://directwebremoting.org/dwr/server/spring
1. 配置web.xml
* 跟原先差不多,只是标签servlet-class的变化
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
2. 配置Spring的xml文件
* 配置名字空间
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
* The configuration tag : <dwr:configuration>
这个标签是必须的,可为空,它的子标签可以是:init, creator, signatures, Converters
* The controller tag : <dwr:controller id="dwrController" debug="true" />
这个标签似乎只跟Spring有密切关系,也必须有
* The remote tag :<dwr:remote javascript="userAjax">
这个标签存在与将被DWR页面端引用的bean标签内部,在这里可以指定哪些方法可被访问
<dwr:include method="convert" /> 指定可被访问的方法