I'm happy to live!

          Develop with pleasure!

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            39 隨筆 :: 2 文章 :: 31 評論 :: 0 Trackbacks
          <2008年12月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          公告

          天下之事敗于懶與私.

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          收藏夾

          友情鏈接

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          今天做個spring和struts的集成Demo,我用的是myeclipse6.5,導入spring框架和struts框架都相當方便,一切就序后,開tomcat,跑吧,相當的不爽,第一個鏈接就爆: servlet action is not available,什么意思啊,難道我的配置文件沒配對?檢查了沒天也沒發現什么問題.
          以下是我的struts  的struts-config.xml:
          <struts-config>
              
          <data-sources />
              
          <form-beans />
              
          <global-exceptions />
              
          <global-forwards />

              
          <action-mappings>
                  
          <action path="/hello" type="com.laxxx.struts.action.Hello">
                      
          <forward name="hello" path="/hello.jsp" />
                  
          </action>
              
          </action-mappings>

              
          <controller
                  
          processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />


              
          <message-resources
                  
          parameter="com.laxxx.struts.ApplicationResources" />


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

                  
              
          <set-property property="contextConfigLocation"
                      value
          ="/WEB-INF/applicationContext.xml" />
              
          </plug-in>
          </struts-config>

          以下是spring的applicationContext.xml:
          <beans xmlns="http://www.springframework.org/schema/beans"
              xmlns:xsi
          ="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation
          ="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

              
          <bean name="/hello" class="com.laxxx.struts.action.Hello">

              
          </bean>
          </beans>

          看了又看找了又找,還是沒看出問題,把struts-config中關于spring兩段配置去掉后,單跑struts是沒問題的,看來很有可能myeclipse沒把包導全啊,可能沒找到,發現好多人都中過此招,有些包沒找到spring的代理請求處理類或者是沒找到初始化spring上下文的插件類,這兩個類都在spring.jar中,于是把這個jar包放入lib目錄中去,重啟tomcat... ... 再點,ok,終于到應該去的地方了.
          posted on 2008-12-04 17:19 Norsor 閱讀(566) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 宣城市| 娄底市| 鄂伦春自治旗| 遵义市| 临朐县| 廉江市| 牡丹江市| 河曲县| 大宁县| 洪江市| 芷江| 新沂市| 西乌珠穆沁旗| 昌平区| 盈江县| 泾川县| 珲春市| 义马市| 夏邑县| 亳州市| 深圳市| 长葛市| 永新县| 绍兴县| 赣榆县| 连南| 赤水市| 南阳市| 卢龙县| 孟连| 肇庆市| 绍兴市| 陇西县| 岑巩县| 海林市| 紫金县| 河北省| 资兴市| 芒康县| 桐柏县| 邵东县|