努力,成長,提高

          在追求中進步
          數據加載中……
          myeclipse開發struts, spring, hibernate配置注意要點(新手入門)

          1.確保以下幾個jar不在project build path里面,否則會出現各種沖突問題.
          c3p0-0.9.0.4.jar
          asm-2.2.3.jar
          hibernate-annotations.jar
          2.添加順序->spring,hibernate,struts
          3.修改 struts-config.xml
          action-mappings標簽里面的type改為org.springframework.web.struts.DelegatingActionProxy
          例如:
          <action attribute="userSearchForm" input="/userSearch.jsp"
                      name="userSearchForm" path="/userSearch" scope="request"
                      type="org.springframework.web.struts.DelegatingActionProxy">
                      <forward name="success" path="success.jsp" />
          </action>
          最后加上
          <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
                  <set-property property="contextConfigLocation" value="/WEB-INF/classes/applicationContext.xml" />
          </plug-in>
          4.applicationContext.xml里面添加
          <bean name="/userSearch" class="com.oocl.struts.action.UserSearchAction">
                  <property name="actionLogDAO">
                      <ref bean="AlActionlogDAO" />
                  </property>
          </bean>
          這里的要注意,是name="/userSearch"不是id
          還有,要確認好這個property的name一定要和你的bean class里面的field符合
          5.myEclipse添加spring,hibernate,struts支持的時候,盡量把所有的jar都包含進來吧,然后把不需要的給刪除掉.


          posted on 2009-02-20 16:34 孔陽 閱讀(730) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 宣汉县| 宁武县| 华池县| 贵港市| 阳信县| 和田县| 大同县| 桓仁| 错那县| 托里县| 景德镇市| 项城市| 东宁县| 吉木乃县| 自治县| 周至县| 鹤山市| 林西县| 遵义市| 穆棱市| 汉沽区| 兴宁市| 广西| 万年县| 铜梁县| 大厂| 阜阳市| 佳木斯市| 会昌县| 广河县| 五原县| 丽江市| 大邑县| 友谊县| 曲周县| 滁州市| 鹤壁市| 慈利县| 屯门区| 南汇区| 普宁市|