Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Converting a project to a dynamic web project in webtools
Converting a project to a dynamic web project in webtools [message #176089] Wed, 02 August 2006 09:16
Eclipse User
Originally posted by: clivejcox.yahoo.co.uk

I know this has been discussed in previous posts but I have still found no
comprehensive step-by-step guide.
I have tried to convert my reasonably complex tomcat-based project to
webtools, succeeded once, accidentally trashed my setup, and was not able to
redo the steps a second-time! I know I should haved backed things up, but it
does reflect the difficulty it getting things converted.

In case anybody can flesh things out precisely - the things I tried were:

1. Ensured my file structure reflected the final deploy structure,
especially with JSP directories inside a WEB-INF directory. In my case I
have the context root as src/web not WebContent.
2. Had my build output directory be src/web/WEB-INF/classes.
3. Added extra files to .settings directory, mostly taken from those created
from a new dynamic web project. Except I customized the
org.eclipse.wst.common.component file, for me this was
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="myProject">
<wb-resource deploy-path="/" source-path="/src/web"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/javajunit"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/javatest"/>
<property name="context-root" value="/"/>
<property name="java-output-path" value="/src/web/WEB-INF/classes"/>
</wb-module>
</project-modules>

So the Java output path has to be in this file as well?
Can I deploy my lib files to WEB-INF/lib from some directory here as well?

4. Added extra buildspec and project natures to the .project file to get
something like:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>playtxt</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>
<buildCommand>
<name>org.jpox.ide.eclipse.enhancerbuilder</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>

5. I added to .classpth

<classpathentry kind="con"
path=" org.eclipse.jst.server.core.container/org.eclipse.jst.server .tomcat.runtimeTarget/Apache
Tomcat v5.5"/>

<classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>

-------------

I had great problems getting my library files which were in src/lib
deployed. I eventually copied them to WEB-INF/lib and tried to add a "web
app libraries" element to the build path. This worked the first time and not
the second.

Similarly, for tomcat libs. See step 5.

Also, had problems in my second failed attempt with the project facets.
Sometimes the file in .settings
org.eclipse.wst.common.project.facet.core.xml was emptied and I needed to
re-add the content:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v5.5"/>
<fixed facet="jst.web"/>
<fixed facet="jst.java"/>
<installed facet="jst.java" version="5.0"/>
<installed facet="jst.web" version="2.3"/>
</faceted-project>

Had problems with my web.xml file which seemed never to be interpreted
properly. i.e. it took me ages to get it to appear under the J2EE
perspective as "deployment descriptor". When opening the project I would see
it there for a second and then it would disappear - I assume becuase some
process wasn't happy parsing it.

Basically, in the end I have given up as I don't have the time to figure out
which chickens I need to slaughter in which order to get it working.

Hope somone can help, so I might have the energy to try again.

Clive

PS As others have said, it would be nice if some effort was put in to allow
projects to be converted to webtools projects automatically.
Previous Topic:Query on creating Controls using the SWT Accessibility API
Next Topic:xdoclet and oc4j
Goto Forum:
  


Current Time: Fri Oct 24 10:21:38 GMT 2014

Powered by FUDForum. Page generated in 0.01986 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software