我使用 maven simple webapp 原型创建了一个 webapp,然后添加了以下依赖项:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
我还将web.xml
文件更改为使用 3.1 版:
<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">
我将java编译器版本更改为1.8。Eclipse 现在抱怨:
Cannot change version of project facet Dynamic Web Module to 3.1.
One or more constraints have not been satisfied.
知道如何消除此错误吗?