我正在使用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類。
你能幫我解決這個問題嗎?