在Eclipse Kepler中为Maven Web App项目创建新的servlet [英] Creating new servlet in eclipse kepler for maven web app project
问题描述
我创建了简单的Maven Web应用程序项目.创建后,没有"src/main/java"和"src/test/java"文件夹,只有"src/main/resources"文件夹.我添加了这两个文件夹并更新了Maven项目.
然后,我在'src/main/java'中添加了一些软件包,并尝试通过右键单击软件包元素来添加servlet
下一步,我将看到带有一些servlet详细信息的窗口
但是当我开始添加servlet名称时,eclipse向我显示不是Java源文件夹"的消息.以同样的方式,我可以毫无问题地向这个包添加简单的类,但是对于servlet,我不能.我在配置过程中会错过什么吗?
我找不到问题的原因,但是我解决了重新启动Eclipse的问题(我已经安装了Eclipse Neon.2 Release(4.6.2)).>
I created simple maven web application project. After creation there were no 'src/main/java' and 'src/test/java' folders but only 'src/main/resources'. I added this two folders and updated maven project.
Than I added some package to 'src/main/java' and try to add servlet by right click at package element
At next step I see window with some servlet details
But when I start to add servlet name eclipse shows me message that "Not a java source folder". By the same way I can add simple class to this pachage without any problem but in case of servlet I cannot. Do I miss something during configuration?
I could not find the cause of the problem, but I solved it restarting Eclipse (I have Eclipse Neon.2 Release (4.6.2)).
这篇关于在Eclipse Kepler中为Maven Web App项目创建新的servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!