隨筆 - 79  文章 - 11  trackbacks - 0
          <2009年2月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          1234567

          不再墮落。
          Oracle documents: 
          http://tahiti.oracle.com/

          常用鏈接

          留言簿

          隨筆分類(66)

          隨筆檔案(79)

          相冊

          收藏夾(11)

          搜索

          •  

          積分與排名

          • 積分 - 53462
          • 排名 - 949

          最新隨筆

          最新評論

          閱讀排行榜

          http://www.liyonghome.cn/index.php/archives/6.html

          首先是準備工作吧,需要以下軟件,均可到官方網址下載
          Struts2: http://apache.etoak.com/struts/binaries/struts-2.0.14-all.zip
          Spring2.5: http://www.springsource.org/,下載spring-framework-2.5.zip(可選)
          common-pool: http://www.apache.org/dist/commons/pool/commons-pool-current.zip
          MyEclipse7: http://www.myeclipseide.com/

                由于Myeclipse的最新版本7.0依然不支持struts2,所以我們需要手動去導入struts2相關jar文件和配置文件,之后使用Myeclipse自動再依次導入Spring2.5,Hibernate3.2。

          一,建立一個新項目:
          1.進入new project,選擇Web Project.
          2.Project Name輸入”SSH2Demo”,另外選擇Java EE 5.0,之后點擊finish創建項目.

          二,手工導入Struts2:
          1.解壓struts-2.0.14-all.zip,找到lib文件夾.copy一下的jar文件到/WEB-INF/lib,當然這并一定是最精簡的,但是至少沒有問題.  [xwork-2.0.7.jar, xml-apis-1.0.b2.jar, struts2-spring-plugin-2.0.14.jar, struts2-core-2.0.14.jar, oro-2.0.8.jar, ognl-2.6.11.jar, freemarker-2.3.8.jar, classworlds-1.1.jar, aopalliance-1.0.jar, antlr-2.7.2.jar以及commons-*.jar]

          2.更新web.xml文件,加入
           <filter>
                  <filter-name>struts2</filter-name>
                  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
              </filter>
              <filter-mapping>
                  <filter-name>struts2</filter-name>
                  <url-pattern>/*</url-pattern>
              </filter-mapping>
           <listener>
                  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
            </listener>

          3.接著創建struts.xml,放到/WEB-INF/classes.
          <?xml version=”1.0″ encoding=”UTF-8″ ?>
          <!DOCTYPE struts PUBLIC
              “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
              “http://struts.apache.org/dtds/struts-2.0.dtd“>
          <struts>
              <!– action內容 –>
          </struts>

          posted on 2009-02-18 23:43 donnie 閱讀(1150) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 嵊州市| 白山市| 沂南县| 吴川市| 黑山县| 邵阳县| 津市市| 南充市| 于都县| 武乡县| 儋州市| 临颍县| 镇赉县| 江油市| 黄山市| 孝昌县| 东乌珠穆沁旗| 兴业县| 磴口县| 大渡口区| 焦作市| 秀山| 文登市| 贡嘎县| 乳源| 武强县| 禹城市| 潢川县| 广汉市| 盐津县| 楚雄市| 洛南县| 都兰县| 台中市| 武定县| 贵州省| 汝州市| 赤峰市| 沾益县| 诏安县| 边坝县|