ssm configuration in web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<! - 1. coding filter configuration this is to intercept all the resources and set the number format. ->
<filter>
<filter-name> EncodingFilter </ filter-name>
<filter-class> org.springframework.web.filter.CharacterEncodingFilter </ filter-class>
<-! 1.1encoding arranged to utf-8 corresponds Request.setCharacterEncoding ( "UTF-. 8"); ->
<the init-param>
<param-name> encoding </ param-name>
<param-value>. 8 UTF-</ param-value>
</ the init -param>
! <- 1.2foreEncoding set to true is equivalent response.setCharacterEncoding ( "UTF-. 8"); ->
<the init-param>
<param-name> forceEncoding </ param-name>
<param-value > to true </ param-value>
</ the init-param>
</ filter>
<


<url-pattern>/*</url-pattern>
</filter-mapping>


<! - Configuring the DispatcherServlet ->
<the servlet>
<the servlet-name> SPRINGMVC </ the servlet-name>
<the servlet-class> org.springframework.web.servlet.DispatcherServlet </ the servlet-class>
<! - 2.1 configuration springMVC need to load the configuration file
if you do not configure the default path is /WEB-INF/applicationContext.xml,
the name of the xml file created in the WEB-INF directory must be applicationContext.xml. ->
<the init-param>
<param-name> contextConfigLocation </ param-name>
<param-value> the CLASSPATH:. The Spring - * xml </ param-value>
</ the init-param>
! <- 2.2 if is 0 or a positive integer, indicates the container when the app starts to load and initialize the servlet,
the smaller the value, the higher the priority of the servlet, the first is more loaded. ->
<Load-ON-Startup>. 1 </ Load-ON-Startup>
<the async-Supported> to true </ the async-Supported>
<

<the servlet-name> SPRINGMVC </ the servlet-name>
<-! 2.3 Match all requests only are two or * .do / ->
<URL-pattern> / </ URL-pattern>
</ Mapping the servlet- >

</web-app>

 

Guess you like

Origin www.cnblogs.com/19322li/p/11100479.html