创建ssm框架的时候,出现报错:
一开始以为是spring版本问题,可是检查发现版本都是较新版本。
网上找了一下解决方法:
1.删除spring-web文件,可以解决,不过会导致注解无法使用。
2.修改web.xml头部
一开始报错的xml文件头部:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
对头部进行修改:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<absolute-ordering>
<name>MyFragment1</name>
<name>MyFragment2</name>
</absolute-ordering>
修改完成之后重新运行: