问题
I have existing Java project and want to add web module to it. Is there any way to add dynamic web project as a module in a Java project using Eclipse?
回答1:
Yes, you can. You need to go to your project settings, find "Project Facets" on the left. Then you can check "Dynamic Web Project" checkbox. Make sure to set up the facet before you hit "Apply" because it will be hard to do later on. There will be "additional configuration" button somewhere once you check the facet.
Adding the web functionality to existing project has always been buggy though. Try it and if it doesn't work then you'd have to create a new project and copy your stuff over.
More detailed info is here: http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jst.j2ee.doc.user%2Ftopics%2Fcfacets.html
来源:https://stackoverflow.com/questions/24763978/how-to-add-web-project-module-in-existing-java-project-in-eclipse