<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml,/WEB-INF/bbgl-servlet.xml,/WEB-INF/xtgl-servlet.xml</param-value>
</context-param>
全局參數 contextConfigLocation 這個參數定義了多個Spring配置文件的位置 好一同進行加載
<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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
其中encoding用來設置編碼格式,forceEncoding用來設置是否理會 request.getCharacterEncoding()方法,設置爲true則強制覆蓋之前的編碼格式。
<jsp-config> 包括 <taglib> 和 <jsp-property-group> 兩個子元素。其中<taglib> 元素在JSP 1.2 時就已經存在;而<jsp-property-group> 是JSP 2.0 新增的元素。<jsp-property-group> 元素主要有八個子元素,它們分別爲:
1.<description>:設定的說明
2.<display-name>:設定名稱
3.<url-pattern>:設定值所影響的範圍,如: /CH2 或 /*.jsp
4.<el-ignored>:若爲 true,表示不支持 EL 語法
5.<scripting-invalid>:若爲 true,表示不支持 <% scripting %>語法
6.<page-encoding>:設定 JSP 網頁的編碼
7.<include-prelude>:設置 JSP 網頁的擡頭,擴展名爲 .jspf
8.<include-coda>:設置 JSP 網頁的結尾,擴展名爲 .jspf
<!-- 404 頁面不存在錯誤 -->
<error-page>
<error-code>404</error-code>
<location>/httperror404.jsp</location>
</error-page>
<!-- 403 頁面不存在錯誤 -->
<error-page>
<error-code>403</error-code>
<location>/httperror403.jsp</location>
</error-page>
<!-- 500 服務器內部錯誤 -->
<error-page>
<error-code>500</error-code>
<location>/httperror500.jsp</location>
</error-page>