----------在 web.xml 文件中的配制----------
<servlet>
<servlet-name>dwr</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
-------在dwr.xml 文件中的配制---------
<dwr>
<allow>
<create javascript="Jstu" creator="spring">
<param name="beanName" value="test"></param>
<include method="findAllStudent" />
</create>
<convert match="pojo.Student" converter="bean"></convert>
</allow>
</dwr>
注:spring表示有spring管理
test是applicationContext.xml中对应的<bean id="test" class="biz.impl.DwrTest"/>的id
beanName表示发布的类别
Jd表示脚本对象
convert 节点中的match代表实体类型,converter是固定的,如果不需要转换可省
--------applicationContext.xml 文件中的配制-------------
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="test" class="biz.impl.DwrTest"/>
</beans>