posts - 15, comments - 6, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          SpringFramework web.xml 配置例子

          Posted on 2007-12-24 15:16 thomas.chen 閱讀(1209) 評論(0)  編輯  收藏 所屬分類: SpringFramework

          一、UTF-8的Request字符集設(shè)定

             <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>
            
            
          <filter-mapping>
                  
          <filter-name>encodingFilter</filter-name>
                  
          <url-pattern>*.do</url-pattern>
            
          </filter-mapping>

          二、加載SpringFramework配置文件
            <listener>
                  
          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
            
          </listener>
            
            
          <context-param>
                  
          <param-name>contextConfigLocation</param-name>
                  
          <param-value>/WEB-INF/conf/applicationContext*.xml</param-value>
            
          </context-param>

          三、配置文件的默認(rèn)約定
          加載/WEB-INF/conf下面所有以applicationContext打頭的xml文件。常見的文件有:
          applicationContext.xml     : 常量資料配置文件;
          applicationContext-datasource.xml  :數(shù)據(jù)庫資料配置文件
          applicationContext-service.xml  :服務(wù)資料配置文件

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 达州市| 香河县| 盖州市| 炎陵县| 精河县| 宁化县| 五原县| 腾冲县| 保康县| 玉田县| 象州县| 伊吾县| 名山县| 综艺| 永丰县| 南江县| 北京市| 永康市| 湘潭县| 济阳县| 安阳县| 潜江市| 通海县| 田东县| 开封县| 闻喜县| 汉沽区| 盐源县| 诸暨市| 曲水县| 栾川县| 萨嘎县| 梁山县| 望都县| 电白县| 洛川县| 彰化县| 龙山县| 金沙县| 崇礼县| 龙海市|