How to Convert to a Dynamic Web project... in Eclipse (Europa) 3.3 or 3.4 (Ganymede)

Ever wondered why "Convert to a Dynamic Web project..." is under the Project Menu in Eclipse?

It is there for one reason and one reason only:

To tease you!

Yes, my friends it is their to tease and mock you.  How do I know this? Wel, it's simple actually.  Notice the trailing "..."?   You most likely are a software developer if you are reading this. Would you really put a "..." after something if it was supposed to work all the time?

"Not that there is anything wrong with that." BUT, let's at least make is a convention.   Vista should put a ... in their Explorer bar since it crashes all the time.  Windows should put a ... in their file searching system because it sucks so bad (I remember reading in the XP days about Microsoft's next operating system main feature was supposed to be a SQL server backed search?--what happened?--I'll tell you what happened it got postponed and delayed like everything else Microsoft does. Can you imagine what would happen if Microsoft actually bought Yahoo?  I can. The search would suck!).

Okay, so back to the point "..."
Well, to be honest "...", "Convert to a Dynamic Web project..." is under the project menu to ONLY convert a Static Web Project to a Dynamic Web Project.  Gee, thanks "..." !   I don't know HOW MANY HAVE EVER CREATED A STATIC WEB PROJECT, BUT "..." I can at least tell you I never have "..."

On to the Tutorial:

Okay, so we all know by now the "..." implies some impossible task, so let's investigate how hard it is to actually accomplish this feat "..."

First, we will create a Java Project in Eclipse 3.4
Here is the source to the freshly created Java Project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Java Project</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

Now let's create a Dymaic Web Project and see what's the Mystery behind the "..." and why Eclipse can't do it for you:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Dynamic Web Project</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>

<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>

</buildSpec>
<natures>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>

<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

Okay, well, I was lucky(not) enough to install the Javscript plug in so you can ignore org.eclipse.wst.jsdt.core.javascriptValidator and org.eclipse.wst.jsdt.core.jsNature.   Now all you have to do to convert your java project to a Dynamic Web project is to insert the portions above that are in bold into your java project, restart Eclipse, and it will now be a Dynamic Web project.

Here is the first project converted to a Dynamic Web Project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Java Project</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>

<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>

</buildSpec>
<natures>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>

</natures>
</projectDescription>