JSP Tutorial


            

Setting up the JSP environment

 

Before setting up the JSP environment, you must make sure you have the JDK.

 

Download JDK 1.3 from the following URL:

http://java.sun.com/j2se/1.3/

 

For Windows, the complete download is about 30 MB.

 

Run through the setup.

 

One of the main problems new Java developers have is setting the PATH and CLASSPATH.

For Windows 95/98/ME you edit the AUTOEXEC.BAT file with the new PATH and CLASSPATH

settings and reboot your machine.

For Windows NT/2000 you edit the environment settings.

 

Both of these changes are described in the Java installation instructions.

 

 

Download the JSP environment

 

You can download JSP environments from the web. http://java.sun.com/products/jsp/download.html

 

The preferred option is to download the J2EE Reference Implementation, Tomcat (approximately 3MB). Tomcat is a free open source JSP and Servlet engine, developed by Apache. Instructions to download Tomcat are given below.

 

 

For Tomcat setup

 

To download Tomcat (current version 3.2.1), go to the following URL:

http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/

 

Download your chosen compressed file, for example on Windows you would download the zip file – 3.0 MB:

http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/jakarta-tomcat-3.2.1.zip

 

Unzip the file into a directory and set an environment variable TOMCAT_HOME to your main Tomcat directory:

 

For example,

 

set TOMCAT_HOME=c:\tomcat

 

 

To start the server change to the tomcat\bin directory and type:

startup

 

 

Open a web browser and in the address box type:

http://localhost:8080/  - this displays the example page.

 

Place any new JSP files in the “webapps” directory under your installed Tomcat directory.

 

For example, to run “myfirst.jsp” file, copy the file into the “webapps/ROOT” directory and then open a browser to the address:

 

http://localhost:8080/myfirst.jsp 

 

This will show you the executed JSP file.

 

 

CONGRATULATIONS - YOUR JSP and SERVLET ENVIRONMENT IS NOW SETUP!