隨筆 - 16  文章 - 0  trackbacks - 0
          <2012年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿

          隨筆檔案

          友情鏈接

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          最近因為開發需要,自己做了一個小的Demo部署在網上,具體網址http://www.17chuxing.com,實現一個類似公交查詢的功能,目前基本上能夠正常運行。

          現在總結一下,以便以后查詢使用;
          一、技術方面
               1、demo的整體技術結構采用比較簡單的Struts+spring+hibernate,struts 可以定義全局的異常、返回值、攔截器,hibernate采用統一的Spring-hibernate模板進行數據提交,減少開發量。如果采用hiberante懶加載方式,需要手工flush(),web.xml需要增加lazyLoadingFilter;
              <filter>
                  <filter-name>lazyLoadingFilter</filter-name>
                  <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
              </filter>
               2、數據量較小采用了mySql作為數據庫,采用mysql需要注意的是早期的mysql版本,表名區分大小寫,a 與A的結果不一樣;
               3、在展現層方面采用sitemesh裝飾器對展現的頁面進行渲染(包括樣式、頁頭、頁腳、統計代碼),保證每個網頁的風格一致性,并且可以減少一定開發工作量;
                  <filter>
                      <filter-name>sitemesh</filter-name>
                      <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
                  </filter>

               4、采用gzipFilter對請求進行壓縮,減少每次請求所需網絡流量;
                  <filter>
                      <filter-name>gzipFilter</filter-name>
                      <filter-class>net.sf.ehcache.constructs.web.filter.GzipFilter</filter-class>
                  </filter>
               5、首頁盡可能減少跳轉(redirect),因為每次跳轉都需要一定的時間;

          二、部署流程
               1、申請域名
               2、選擇虛擬機托管商
               3、部署程序
               4、申請備案

          三、其他方面;
                1、向搜索引擎提交網站
                2、其它思考點,通過rewrite 技術實現反寫,生成相應的靜態文件;
          <filter>
                  <filter-name>rewriteFilter</filter-name>
                  <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
                  <!-- sets up log level (will be logged to context log)
                      can be: TRACE, DEBUG, INFO (default), WARN, ERROR, FATAL, log4j, commons, sysout:{level} (ie, sysout:DEBUG)
                      if you are having trouble using normal levels use sysout:DEBUG -->
                  <init-param>
                      <param-name>logLevel</param-name>
                      <param-value>commons</param-value>
                  </init-param>
                  <!-- set the amount of seconds the conf file will be checked for reload
                      can be a valid integer (0 denotes check every time,
                      -1 denotes no reload check, default -1) -->
                  <init-param>
                      <param-name>confReloadCheckInterval</param-name>
                      <param-value>-1</param-value>
                  </init-param>
              </filter>
          posted on 2012-04-25 13:16 民工二代 閱讀(521) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 三原县| 太湖县| 随州市| 清涧县| 志丹县| 洪洞县| 西充县| 银川市| 胶州市| 齐河县| 枝江市| 白水县| 鹤庆县| 子洲县| 崇州市| 长沙县| 星子县| 永济市| 江源县| 新和县| 宝兴县| 桂阳县| 准格尔旗| 常山县| 托里县| 灵璧县| 大连市| 沙坪坝区| 望奎县| 扶绥县| 秀山| 广汉市| 葵青区| 吉林省| 长岛县| 泰安市| 五莲县| 衡南县| 宁远县| 新宁县| 武城县|