Eclipse Kepler not generating web.xml automaticall

2019-07-04 03:31发布

问题:

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.