直掛云帆濟滄海,展翅遨翔登九天!

          我要飛得更高...

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            19 隨筆 :: 0 文章 :: 5 評論 :: 0 Trackbacks
           

          系統實現規范:以面向接口的方式進行編程。
          下圖為三層邏輯結構的簡易關系圖

           

           

          以上是簡易的系統邏輯結構,
          ***Action繼承于xworkSupportAction,通過Spring來進行管理,在整個Spring的容器中,Spring負責管理整個系統的所有Bean,并負責初始化Bean之間的依賴關系。***Action中注入了服務層對象***ServiceImpl,ServiceImpl又注入了***DaoImpl對象。下面會逐步細化上面的關系圖。

          先看下面的web.xml配置

          web.xml

              <display-name>Struts Blank</display-name>

              <context-param>

                  <param-name>webAppRootKey</param-name>

                  <param-value>wxy.root</param-value>

              </context-param>

              <!-- spring xml文件配置目錄在class目錄下的spring目錄中WEB-INF/classes/spring -->

              <context-param>

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

                  <param-value>classpath*:spring/*.xml</param-value>

              </context-param>

              <!-- 配置log4j的日志信息WEB-INF/classes/config/log4j.properties -->

              <context-param>

                  <param-name>log4jConfigLocation</param-name>

                  <param-value>classpath*:config/log4j.properties</param-value>

              </context-param>

              <!-- 配置Character Encoding Filter -->

              <filter>

                  <filter-name>encodingFilter</filter-name>

                  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

                  <init-param>

                      <param-name>encoding</param-name>

                      <param-value>UTF-8</param-value>

                  </init-param>

              </filter>

              <!-- 配置Struts2 -->

              <filter>

                  <filter-name>struts2</filter-name>

                  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

              </filter>

              <filter-mapping>

                  <filter-name>encodingFilter</filter-name>

                  <url-pattern>/*</url-pattern>

              </filter-mapping>

              <filter-mapping>

                  <filter-name>struts2</filter-name>

                  <url-pattern>/*</url-pattern>

              </filter-mapping>

             

              <welcome-file-list>

                  <welcome-file>index.html</welcome-file>

              </welcome-file-list>

              <!-- 載入Spring ApplicationContext -->

              <listener>

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

              </listener>

              <!-- Spring 刷新Introspector防止內存泄漏 -->

              <listener>

                  <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>

              </listener>
          未完待續.

           
          posted on 2008-07-28 22:15 周大俠 閱讀(223) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 平顶山市| 伊宁县| 定襄县| 尖扎县| 观塘区| 恭城| 鸡泽县| 阿拉善左旗| 澳门| 南江县| 正定县| 永康市| 丹棱县| 元江| 廉江市| 沙田区| 阿拉善盟| 措美县| 娄烦县| 固阳县| 饶河县| 广丰县| 肇源县| 贡山| 华坪县| 长寿区| 五常市| 炎陵县| 马山县| 稷山县| 哈密市| 济阳县| 永济市| 张家界市| 嘉兴市| 泸定县| 阿合奇县| 宜丰县| 凯里市| 专栏| 龙口市|