heroku/devcenter-embedded-tomcat — pull request #1 by jsimone (2011-12-21 06:47:44+00:00)
Title: Add web.xml and remove Servlet 3.0 annotations

The embedded Tomcat container initialization won't read Servlet 3.0 annotations from anywhere except jars in the classpath or WEB-INF/classes. This is fine for appassembler scripts because the jar of the app itself goes on the classpath. However it's an issue when launching from Eclipse. The Servlet in the demo doesn't work.

Another way around this would be to drop the web.xml and use programmatic servlet registration:

Tomcat.addServlet(ctx, "MyServlet", "servlet.HelloServlet");
ctx.addServletMapping("/hello", "MyServlet");

The Servlet 3.0 annotations would still have to be removed.

Will make updates to the article after I get any feedback on this change.