步骤:
1.打开web.xml,查看下version是否是3.0
<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">
2.打开项目下.setting目录下的org.eclipse.wst.common.project.facet.core.xml ,"jst.web"对应的version改为“3.0”
<?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed facet="wst.jsdt.web"/> <installed facet="wst.jsdt.web" version="1.0"/> <installed facet="jst.web" version="3.0"/> <installed facet="java" version="1.7"/> </faceted-project>
3.执行项目右键Maven的Update Project.
dynamic web module 版本之间的区别:
Servlet 3.0 | December 2009 | JavaEE 6, JavaSE 6 | Pluggability, Ease of development, Async Servlet, Security, File Uploading |
Servlet 2.5 | September 2005 | JavaEE 5, JavaSE 5 | Requires JavaSE 5, supports annotations |
Servlet 2.4 | November 2003 | J2EE 1.4, J2SE 1.3 | web.xml |