I’ve been focusing a lot of my attention on Eclipse Web Tools over the past few days. I’ve been looking mostly at how one builds servlets, JSPs, and EJBs using Eclipse Web Tools. I’ve been using Web Tools 2.0M4 (along with its specified prerequisites).
Today, I turned my attention to importing existing applications. Eclipse has a feature for importing from a WAR file, but I wanted to determine how easy it is to share the source for a web application created using different tools. I devised a simple test: I created and tested a web application containing a single servlet and JSP using an Eclipse competitor; then I imported the application directly from the file system into Eclipse.
The process was straightforward. I used the “New Project” wizard to create a new “Dynamic Web Project” (aside: see bug 173901; there seems to be buy-in from the committer community that we can streamline a bit by generalizing into a single notion of a “Web Project”). Instead of creating the project inside my workspace directory, I pointed the wizard to the existing directory containing the existing web application.
You can see the “Use default” box is unchecked and that I’ve specified the directory containing my project.
A couple pages into the wizard, I’m invited to specify the “Content Directory” directory. This is where all the metadata and JSPs live; here, I specify the directory, relative to the project root, containing this information. At the same time, I specify the location of the Java source code (also relative to the project root).
At this point, the import process is done. Running the project is a simple matter of highlighting my servlet and selecting “Run As… > Run on Server”.
I’ve captured the process in a screen cam which is available here (you may have to wait for the mirrors to catch up). The whole process takes about a minute.