Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web.xml and remove Servlet 3.0 annotations #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jsimone
Copy link
Contributor

@jsimone jsimone commented Dec 21, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants