问题
I saw a tutorial according to which web.xml was being created automatically in the WEB-INF folder in a dynamic web project and it included all the servlets and all the JSP pages and HTML pages were being included automatically. However, I cannot find any such file in my project. The IDE is not showing any error in the jsp and servlets that I have created.
When I added the web.xml file myself, the server stopped working.
I am using Apache Tomcat 7. Am I missing something or have I not done the integration properly?
回答1:
You missed a checkbox which says generate web.xml
just before hitting finish button while creating dynamic web project in eclipse.
The project works fine without web.xml because it uses annotations for request mapping.
来源:https://stackoverflow.com/questions/20019934/eclipse-kepler-not-generating-web-xml-automatically