1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Installing and Using Eclipse Web Tools with Apache Tomcat

Discussion in 'Other Development Tools' started by professional, Sep 14, 2008.

  1. professional

    professional Active Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    80
    Installing and Using Eclipse Web Tools with Apache Tomcat

    In this post, I will concisely try to demonstrate how to install and configure Eclipse Java Enterprise Edition (for J2EE) with Apache Tomcat server.

    Firstly, it is important that your computer system be loaded with Sun Java Developer Kit or JDK. Go to sun download and download the latest version of JDK. After you install it, remember the installation path as we would require it during Eclipse web tools installation.

    Secondly, you need to install Apache Tomcat on your computer system:

    • Download the installation file from http://tomcat.apache.org/
    • Make sure that you do not have an earlier instance or earlier version of Apache Tomcat installed on your system.
    • If yes, remove any such earlier installation of Apache Tomcat before proceeding.
    • To begin installation you need to run the Windows Service Installer.
    • Select the destination folder.
    • You would be prompted to enter admin password for Apache Tomcat.
    • Once you have installed Apache Tomcat on your computer, next is to install Eclipse Web Tools.

    Thirdly, to install Eclipse Web Tools you need to download the software from http://www.eclipse.org/downloads/. You can get confused with the various different download options. We need the Java Enterprise Edition for developing web applications; therefore, you need to download Eclipse IDE for Java EE Developers. Choose the appropriate download mirror to download the software to your computer system.

    Now, just follow the simple steps:
    • Download the installation zip file on your computer.
    • Unzip the file by right clicking on the file.
    • Select the destination path of unzipped file. You should set the destination path to the subdirectory where JDK was installed.

    So now, we have installed Sun JDK, Apache Tomcat and Eclipse Web tools. In next post, I will demonstrate how to use Eclipse Web Tools with Apache Tomcat to create the web applications.
     
  2. professional

    professional Active Member

    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    80
    To learn how to use Eclipse Web Tools with Apache Tomcat you need to understand the way the projects are created. For this, open Eclipse Web Tools and click on the ‘New’ sub-menu option.

    [​IMG]

    • Select the ‘Dynamic web project’ option.
    • Click on the Next button.
    • Enter a project name
    • You will need to give a target runtime and configurations. To change the target runtime click on the ‘New’ button on the right side.
    • Choose the installed Apache Tomcat and tick on create a new local server and click next.
    • Choose the Tomcat installation directory by browsing to the specified folder.
    • Click on Finish button.
    • You would be directed back to the New Dynamic Web Project window.
    • Click on the finish button.
    [​IMG]

    • Right click on the web project.
    • Choose the New menu option and click on the Servlet option.
    [​IMG]

    • Give a name and click finish.
    • Now you can create Servlet using Eclipse Web Tools with Apache Tomcat.
    • After your code is written, to run select choose Run -> Run as -> Run on server
    • Eclipse will start the server itself, and you will se your web page in Eclipse’s internal browser. If the server was already running, first stop it using the system tray icon.
    • You should note the url to see the page in your external browser.
    So there we have it, complete guide to getting those JSP pages up and running.