web.xml部分基本标签的作用,菜鸟记录

<context-param>
<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>

你可能感兴趣的:(web.xml部分基本标签的作用,菜鸟记录)