努力,成長,提高

          在追求中進步
          數據加載中……
          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 孔陽 閱讀(737) 評論(0)  編輯  收藏


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


          網站導航:
           
          主站蜘蛛池模板: 新巴尔虎右旗| 章丘市| 伊金霍洛旗| 博罗县| 驻马店市| 盐池县| 晋江市| 浦北县| 龙口市| 德兴市| 如东县| 宝山区| 龙泉市| 孟连| 蓝田县| 新乡县| 洪湖市| 桓仁| 卢氏县| 农安县| 亚东县| 泰顺县| 和田市| 永善县| 荆门市| 甘泉县| 鞍山市| 梓潼县| 长白| 安庆市| 洪雅县| 西乡县| 泊头市| 公安县| 双桥区| 方城县| 武穴市| 长乐市| 瑞昌市| 枣强县| 财经|