dwr使用手册根据项目整理

前端之家收集整理的这篇文章主要介绍了dwr使用手册根据项目整理前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.DWR 放入你的工程
1
)从官方网站(http://getahead.org/dwr/download)下载dwr.jar包。然后将它放在你webappWEB-INF/lib目录下。
2
)将下载的dwr.jarorgdirectwebremoting内的engine.jsutil.js放入WEB 应用中,比如js 文件夹下(可选)

2 编辑配置文件

1web.xml

<servlet>

<servlet-name>dwr-invoker</servlet-name>

<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>

<init-param>

<param-name>debug</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<param-name>crossDomainSessionSecurity</param-name>

<param-value>false</param-value>

</init-param>

<init-param>

<param-name>allowScriptTagRemoting</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<description>ReverseAjaxEnabled</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>3</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>dwr-invoker</servlet-name>

<url-pattern>/dwr/*</url-pattern>

</servlet-mapping>

2)集成spring的时候spring-config.xml配置

<!--DWR 配置BEGIN -->

<!-- 启动 DWR 注解配置模式-->

<dwr:configuration >

<dwr:converttype="exception" class="java.lang.Exception">

<dwr:includemethod="message"/>

</dwr:convert>

</dwr:configuration>

<dwr:annotation-configid="dwrid"/>

<dwr:url-mapping />

<!-- 开启dubug状态-->

<dwr:controller debug="true"/>

<!-- DWR 配置END-->

猜你在找的Ajax相关文章