Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

ide

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!

like image 410
Mauli Avatar asked Oct 17 '09 07:10

Mauli


People also ask

How do I change the WebContent folder in Eclipse?

Use CTRL+SHIFT+R to open it. > Replace WebContent with the folder you need. > Please comment and/or vote on it if you are interested.

What is WebContent folder in Eclipse?

WebContent folder is always considered as client side code in Java web projects. It contains like HTML, Css, JavaScript, jQuery, JSP pages etc. It also contains some configurations like how urls will be called i.e. . XML files with some configurations.

How do I rename a folder in Eclipse?

Right-mouse click in the repository view on the folder you want to rename and choose Rename path process. Rename the folder. Invoke "Add to Workspace". Perform synchronizing the Eclipse project folder and change will be reflected.


2 Answers

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.
  • like image 131
    Mugabo Avatar answered Sep 29 '22 18:09

    Mugabo


    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.

    like image 37
    Peter Štibraný Avatar answered Sep 29 '22 20:09

    Peter Štibraný