我正在使用Wildfly 10并尝试在其上部署我的Web应用程序。问题在于,如果使用@WebServlet(name = "/testServlet")
注释进行注释,则不会部署servlet。当我在web.xml中进行servlet映射时(我使用JavaEE 7,因此我想用注释映射servlet),它仍然被部署。 我的web.xml看起来像Servlet容器未找到servlet(WebServlet注释不起作用)
<?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">
</web-app>
,所以我提到了3.1 webapp。我检查了我的.war archieve中的类,并且存在servlet类。
你能帮我解决这个问题吗?