滿店香的家

          學習+實踐=進步

          用spring配置文件來管理DWR (轉)

          http://zhdf.blog.sohu.com/76726574.html
          dwr主動對于spring做了融合工作,myeclipse里有樣例可供下載DWRSpringJPAExample,不錯,不錯

          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns="http://www.springframework.org/schema/beans"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:tx="http://www.springframework.org/schema/tx"
                  xmlns:aop="http://www.springframework.org/schema/aop"
                  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.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
                  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                  http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd">
                 
                  <bean id="countryUtil" class="com.newegg.demo.dwr.CountryUtil">
                          <dwr:remote javascript="Country" />
                  </bean>
                 
                  <bean id="personFetcher" class="com.newegg.demo.dwr.PersonFetcher">
                          <dwr:remote javascript="PersonFetcher" />
                  </bean>
                 
                  <bean id="spinUtil" class="com.newegg.demo.dwr.SpinUtil">
                          <dwr:remote javascript="Spin" />
                  </bean>

                  <bean id="progressMonitor" class="com.newegg.demo.dwr.ProgressMonitor">
                          <dwr:remote javascript="ProgressMonitor" />
                  </bean>

                  <dwr:configuration>
                          <dwr:convert class="com.newegg.demo.dwr.Person" type="bean" />
                  </dwr:configuration>
                 

          </beans>

          dwr的單獨配置文件dwr.xml可以省略,但是在web.xml中需要把原來的Dwr Servelet:org.directwebremoting.servlet.DwrServlet更換為org.directwebremoting.spring.DwrSpringServlet,其他配置均保持不變。

          以上配置的spring版本是2.0+,DWR是2.0+。

          對于DWR想更多了解的請看下面的示例DEMO。

          http://upl.codeq.info/ajaxkurs/ajaxkurs.zip

          posted on 2008-06-02 18:05 滿店香 閱讀(838) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 香格里拉县| 明光市| 民乐县| 惠安县| 荃湾区| 平和县| 巧家县| 柯坪县| 阿尔山市| 鹤壁市| 鄂州市| 资源县| 出国| 阿克陶县| 舒城县| 西青区| 平定县| 巴青县| 宜章县| 大连市| 米泉市| 紫阳县| 社旗县| 安新县| 威远县| 利辛县| 博客| 东阿县| 永昌县| 盖州市| 团风县| 新竹县| 丹阳市| 光山县| 九龙坡区| 壶关县| 汤原县| 冷水江市| 柞水县| 安塞县| 大城县|