Loading...

          java .net

          2007-1-15 星期一

          今天練習了dwrstrutsspring集成,其中與struts集成有點小錯誤還沒查出來,在網上找資料也沒有解決。Spring集成倒是挺爽的,順便回顧了spring的設置,如果springstrtus集成,首先無論哪種方式都需要在struts-config.xml中以插件方式引入spring的一個加載類ContextLoaderPlugin

          <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">

             <set-property property="contextConfigLocation"  value="/WEB-INF/applicationContext.xml" />

          </plug-in>

          可以用spring的一個接口DelegatingRequestProcessor替換org.apache.struts.action.RequestProcessor類,在web.xml中設置.

           還可以將strutsAction類交給spring的代理類來處理。

          還有就是如果只是簡單web應用,不用struts,那么在web.xml配置文件中配置一個spring監聽器或者servlet,例如

          <context-param>

              <param-name>contextConfigLocation</param-name>

              <param-value>/WEB-INF/classes/applicationContext.xml</param-value>

            </context-param>

           

            <listener>

             <listener-class>org.springframework.web.context.ContextLoaderListener

          </listener-class>

            </listener>

          這樣在用到spring Ioc中的對象時就用WebApplicationContextUtils來加載。

          posted on 2008-08-26 22:06 閱讀(93) 評論(0)  編輯  收藏


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


          網站導航:
           

          公告

          希望有一天

          我能用鼠標雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導航

          <2008年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          統計

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網絡

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 乃东县| 中宁县| 万荣县| 东平县| 同仁县| 阜新市| 婺源县| 美姑县| 贡嘎县| 兴义市| 宜黄县| 诏安县| 阳信县| 思南县| 高州市| 龙南县| 凯里市| 铜山县| 交口县| 敦煌市| 大安市| 榆林市| 吉林市| 金阳县| 喀喇沁旗| 合山市| 宁武县| 进贤县| 鲁甸县| 沧州市| 临颍县| 宿州市| 大田县| 岐山县| 资阳市| 云阳县| 贵州省| 祁阳县| 万载县| 娄烦县| 辽宁省|