2009-09-23

Setup Apache Tomcat to host JSP

JSP (Java Server Page) is Java based web programming language. Similar to ASP and ASPX (and different from PHP), JSP can be compiled into classes before used in the pages. To start coding in JSP, we need to setup Apache Tomcat first. Follow the steps below:

  1. Download JDK (Java Development Kit) from Java Website. Any version will do, but if you don't have any idea, just download and install the newest version.
  2. Download Apache Tomcat from Apache Tomcat Website. Currently there are versions 4.1, 5.5 and 6.0. Either version will do, or just pick the newest version.
  3. There are 2 types of Tomcat installation file, zip and windows installer. Either type is fine, or just download the zip version. Extract the zip file to any directory.
  4. Go to the Tomcat directory that you extracted (or installed), go to bin folder and edit the startup.bat file.
  5. Add the JAVA_HOME environment variable at the beginning of the startup.bat file (after @echo off)
    set java_home=C:\Program Files\Java\jdk1.6.0_16

  6. Then you may double click the startup.bat to start Tomcat. If a command terminal is shown without disappearing, it properly means OK.
  7. To test it out, open a browser and go to localhost:8080. If something come out (not the error message of course), that means you have setup Tomcat successfully.

0 comments: