我将项目复制到Tomcat中的子目录中的Web App文件夹中。 它似乎无法找到servlets !!!
链接: http://localhost:8084/Amirhosein/MyServlet
错误:HTTP状态[404] - [未找到]
Web.xml中:
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.royalvas.service</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.royalvas.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet</url-pattern>
</servlet-mapping>
答案 0 :(得分:0)