I don't know how those error occured,the project goes no any problem just now.
I remember I renamed the index.jsp and create a new RestController.
The error say "Element param-serviceName is not allowed here".
Here are some images show the errors
web.xml:
applicationContext.xml:
and the code of the web.xml as follows,others xml files like the web.xml
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">
<!--配置Spring核心监听器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--指定Spring的配置文件-->
<context-param>
<param-serviceName>contextConfigLocation</param-serviceName>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!--Spring MVC的前端控制器-->
<servlet>
<servlet-serviceName>springmvc</servlet-serviceName>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-serviceName>contextConfigLocation</param-serviceName>
<param-value>/WEB-INF/springmvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<multipart-config>
<!--临时文件的目录-->
<location>/tmp/</location>
<!-- 上传文件最大2M -->
<max-file-size>2097152</max-file-size>
<!-- 上传文件整个请求不超过4M -->
<max-request-size>4194304</max-request-size>
</multipart-config>
</servlet>
<servlet-mapping>
<servlet-serviceName>springmvc</servlet-serviceName>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--编码过滤器-->
<filter>
<filter-serviceName>characterEncodingFilter</filter-serviceName>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-serviceName>encoding</param-serviceName>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-serviceName>forceEncoding</param-serviceName>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-serviceName>characterEncodingFilter</filter-serviceName>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--session有效时间-->
<session-config>
<session-timeout>30</session-timeout>
</session-config>