How do I change in an eclipse web project the WebContent folder to something different?

核能气质少年 提交于 2019-12-18 10:48:15

问题


With the Galileo release it is finally possible to convert a normal Java project to a dynamic web project. Unfortunately it assumes that the Web stuff is located in a folder WebContent, which is not necessarily the case for an existing project. How can I change it? In MyEclipse it is quite easy, but with a stock eclipse I don't find such an option!


回答1:


I am not sure what you meant by "a stock eclipse", but Helios allows this functionality in a very straight-forward way:

  • Right click your dynamic web project and open "Properties".
  • Find Deployment Assembly and you should be able to set context paths from there.



  • 回答2:


    I am not sure if there is UI for this or not, but you can edit file .settings/org.eclipse.wst.common.component, and change following line:

    <wb-resource deploy-path="/" source-path="/WebContent"/>
    

    Change /WebContent to your preferred directory. I use this for a several years now and encountered no problems with it.




    回答3:


    Go in the project properties and do like this example where I use the Maven webapp folder:



    来源:https://stackoverflow.com/questions/1581683/how-do-i-change-in-an-eclipse-web-project-the-webcontent-folder-to-something-dif

    标签
    易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
    该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!