maven 建立一个web-app后. 选择JDK1.7. 不能选择Dynamic Web Module3.0的修改办法.
第一步: 先选择JDK1.7
第二步: 修改pom.xml 添加:
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins>
第三步: 修改/WEB-INF/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_0.xsd" version="3.0"> <display-name>Archetype Created Web Application</display-name> </web-app>
第四步: 修改项目目录下的\ssbm\.settings\org.eclipse.wst.common.project.facet.core.xml 文件.
2.3 改成3.0
<faceted-project> <fixed facet="wst.jsdt.web"/> <installed facet="jst.web" version="3.0"/> <installed facet="wst.jsdt.web" version="1.0"/> <installed facet="java" version="1.7"/> </faceted-project>
完成