滿店香的家

          學習+實踐=進步

          用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)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 南阳市| 沧州市| 阿拉善盟| 荥经县| 鹤壁市| 大港区| 什邡市| 咸阳市| 隆化县| 永修县| 土默特右旗| 建水县| 金阳县| 申扎县| 衡阳县| 漳平市| 孟州市| 顺平县| 桃园市| 汝城县| 太仓市| 阿勒泰市| 田阳县| 新巴尔虎左旗| 白水县| 莱州市| 静海县| 霍林郭勒市| 陵川县| 茌平县| 吴忠市| 松溪县| 柘城县| 柯坪县| 稷山县| 正镶白旗| 五台县| 古交市| 河北省| 万荣县| 库车县|