Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (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 UserFriend
Originally posted by:

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"/>

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"?>
<name>org.eclipse.wst.common.project.facet.core.builder</name >
<nature>org.eclipse.wst.common.project.facet.core.nature</nature >
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature >

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"


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"?>
<runtime name="Apache Tomcat v5.5"/>
<fixed facet="jst.web"/>
<fixed facet=""/>
<installed facet="" version="5.0"/>
<installed facet="jst.web" version="2.3"/>

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.


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: Sun Aug 19 19:06:15 GMT 2018

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

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

Back to the top