Java Chatter and Random Nagging

Thursday, October 26, 2006

Setting up Eclipse WTP and Tomcat

I am currently working on a billing application for an international express/freight company. It required some configuration effort to set up Eclipse WTP and Apache Tomcat (4.0 in my outdated case !!) to debug and run together.

Let's go over the steps to do this:
  1. Create a workspace and import the projects into your Eclipse WTP.
  2. Create a New Server (File - New - Other..) in your Eclipse WTP.
    • Configure your server by pointing to the home folder of your webserver and selecting the JRE.
    • Eclipse WTP creates the local configuration files under your workspace (in my case, in the folder "Tomcat v4.0 Server @ localhost-config").
  3. Open server.xml in your local configuration folder and add the following line :

    <Context path="/${webapp}" docbase="${projectlocation}/${webfolder}" debug="0" privileged="true"/>

    where:
    ${webapp} is your webapplication entry,
    ${projectlocation} is the location of your project
    ${webfolder} is the folder containing your jsp's and WEB-INF folder.
    This line points the Tomcat server to the correct context path so we do not have to deploy everything in our webapps folder but can compile and test everything from within our working directory.
  4. Start/Debug the server from within Eclipse WTP.

0 Comments:

Post a Comment

<< Home