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

          SpringFramework web.xml 配置例子

          Posted on 2007-12-24 15:16 thomas.chen 閱讀(1209) 評(píng)論(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ù)資料配置文件

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 恩施市| 三台县| 安泽县| 华亭县| 阿拉善左旗| 景谷| 图片| 兖州市| 宜丰县| 应用必备| 潼关县| 深州市| 淅川县| 东兰县| 大足县| 房产| 武定县| 宣汉县| 襄樊市| 林甸县| 搜索| 多伦县| 屯门区| 会泽县| 灌云县| 张北县| 墨竹工卡县| 鲁甸县| 鄂托克前旗| 交城县| 临洮县| 饶平县| 淳安县| 育儿| 汨罗市| 南郑县| 出国| 高碑店市| 长泰县| 汤阴县| 宁明县|