Converting a Java Project to a Dynamic Web Project
Asked Answered
B

4

26

I'm using Eclipse Ganymede to create a web application, but the project's currently just a standard Java project. I want to convert it to a Dynamic Web Project and I need a hand in doing that.

I've had suggestions given to me about editing the .project file, but when I restart Eclipse it refuses to open the project claiming the file is corrupt. There's also no facet management options in the project properties.

Any suggestions?

Backbreaker answered 8/5, 2009 at 7:58 Comment(0)
B
11

Well. I'll tell you why, folks. It's because a lot of these guides miss out some fundamental things.

  1. Yes, you need to change the .project file to add some missing natures and builders (create a new Dynamic Web Project and examine the created .project file to see what's missing).

  2. You also need to add things to the .settings folder. It'll be missing two or three files, one of which is a key xml file. They're all required for it to understand the new natures you've given it.

Huzzah for computers.

Backbreaker answered 8/5, 2009 at 8:33 Comment(1)
scottmurphy.info/…Hanes
P
17

Although this question is already answered I'd like to say that I managed to convert my project into web project by changing project facets Properties->Project Facet and just checked Dynamic Web Module

Propene answered 23/11, 2010 at 17:35 Comment(2)
It does not always work as the menu project facet is not always available. E.g converting from a Java project to Dynamic Web Project. In fact, I had to modify the .project before doing that operation.Humour
In Indigo, you have to select project Facets in properties and then click on the convert to faceted form. Then you can add Dynamic web module.Namaqualand
B
11

Well. I'll tell you why, folks. It's because a lot of these guides miss out some fundamental things.

  1. Yes, you need to change the .project file to add some missing natures and builders (create a new Dynamic Web Project and examine the created .project file to see what's missing).

  2. You also need to add things to the .settings folder. It'll be missing two or three files, one of which is a key xml file. They're all required for it to understand the new natures you've given it.

Huzzah for computers.

Backbreaker answered 8/5, 2009 at 8:33 Comment(1)
scottmurphy.info/…Hanes
S
7

When you cannot add the "Dynamic Web Module" via "Project Facets" make sure you unlock and disable the "Utility Module" since they are mutually exclusive.

I've spend quite sometime (re)editing the raw .project-file (according to the earlier mentioned sites) until I discovered this. It was probably was set when I was messing with my maven configuration.

Sacrosanct answered 17/8, 2011 at 14:22 Comment(1)
Also works in RAD. I was stuck trying to change project nature, this helped me a lot.Joe
F
1

Run on server option is not displaying in eclipse .

The solution for it that i found is " check Project properties / Project Facets / Dynamic Web module" . For this we need to unlock utility module and then check Dynamic Web Module.

But , Utility module is also necessary for Java EE Application. So how to select both Utility and Dynamic Web Module to make it Dynamic Web Project so that we can get Run On server Option.

Note : I have already copied necessary things in .project file and files in .settings folder.

Funky answered 3/10, 2013 at 12:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.