My Project is Named "A" and my class is:
@WebServlet(urlPatterns={"/test/*"})
public class RequestHandler extends HttpServlet {
Maven plugin:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
</plugin>
Under src/main/webapp/WEB-INF/web.xml I've got
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"/>
Tomcat7 starts like this when running tomcat7:run:
Running war on http://localhost:8080/A
...
Aug 08, 2012 12:28:08 PM org.apache.coyote.AbstractProtocol init Information: Initializing ProtocolHandler ["http-bio-8080"] Aug 08, 2012 12:28:08 PM org.apache.catalina.core.StandardService startInternal Information: Starting service Tomcat Aug 08, 2012 12:28:08 PM org.apache.catalina.core.StandardEngine startInternal Information: Starting Servlet Engine: Apache Tomcat/7.0.25 Aug 08, 2012 12:28:08 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment Information: No global web.xml found Aug 08, 2012 12:28:09 PM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler ["http-bio-8080"]
When I go to http://localhost:8080/A
or http://localhost:8080/A/test
I get an 404 from Tomcat7
What am I doing wrong?