滿店香的家

          學習+實踐=進步

          用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 滿店香 閱讀(840) 評論(0)  編輯  收藏


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


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 德昌县| 镇雄县| 车险| 临朐县| 古交市| 保山市| 卢湾区| 通城县| 晋宁县| 隆林| 灵宝市| 榆树市| 常熟市| 成武县| 海阳市| 永安市| 高安市| 泰州市| 砀山县| 永吉县| 本溪市| 苗栗市| 镇宁| 怀安县| 喀喇沁旗| 宣恩县| 青田县| 永清县| 宁明县| 德惠市| 衡东县| SHOW| 红安县| 旅游| 永新县| 凤冈县| 阿克苏市| 阿拉善盟| 广德县| 惠安县| 淮北市|