Eclipse Kepler无法自动生成web.xml [英] Eclipse Kepler not generating web.xml automatically

查看:87
本文介绍了Eclipse Kepler无法自动生成web.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了一个教程,根据该教程,将在动态Web项目的WEB-INF文件夹中自动创建web.xml,其中包含所有servlet,并且将自动包含所有JSP页面和HTML页面.但是,我在项目中找不到任何此类文件. IDE在我创建的jsp和servlet中未显示任何错误.

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.

当我自己添加web.xml文件时,服务器停止工作.

When I added the web.xml file myself, the server stopped working.

我正在使用Apache Tomcat7.我是否缺少某些东西或没有正确完成集成?

I am using Apache Tomcat 7. Am I missing something or have I not done the integration properly?

推荐答案

在Eclipse中创建动态Web项目时,在单击完成"按钮之前,您错过了显示generate web.xml的复选框. 没有web.xml的项目可以正常工作,因为它使用注释进行请求映射.

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.

这篇关于Eclipse Kepler无法自动生成web.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆