JSP development environment construction
The JSP development environment is where you develop, test, and run JSP programs.
This section describes how to build a JSP development environment.
Configure Java development tools (JDK)
This step involves downloading Java SDK and configuring PATH environment variables.
You can download the SDK: Java SE Downloads from the Oracle Java page.
After the Java SDK is downloaded, install and configure the SDK according to the given instructions. Finally, set the PATH and JAVA_HOME environment variables to specify the folder paths including java and javac, usually java_install_dir/bin and java_install_dir.
If you are using a Windows system and the SDK installation directory is C: \ jdk1.5.0 _ 20, you need to add the following two lines in the C: \ autoexec. bat file:
Set PATH = C: \ jdk1.5.0 _ 20 \ bin; % PATH %
Set JAVA_HOME = C: \ jdk1.5.0 _ 20
Alternatively, in Windows NT/2000/XP, you can right-click my computer icon, select Properties, then advanced, and then environment variables, next, you can easily set the PATH variable and confirm to exit.
In Linux/Unix systems, if the SDK installation directory is/usr/local/jdk1.5.0 _ 20 and the C shell is used, you need. add the following two lines to the cshrc file:
Setenv PATH/usr/local/jdk1.5.0 _ 20/bin: $ PATH
Setenv JAVA_HOME/usr/local/jdk1.5.0 _ 20
Alternatively, if you are using an integrated development environment similar to Borland JBuilder, Eclipse, IntelliJ IDEA, and Sun ONE Studio, you can try to compile and run a simple program to determine whether the IDE (integrated development environment) knows the SDK installation directory.
In this step, you can also refer to the tutorial in the Java Development Environment configuration section on this site.
Set the Web server: Tomcat
Currently, the market has many Web servers that support JSP and Servlets development. Some of them can be downloaded and used for free. Tomcat is one of them.
Apache Tomcat is an open-source software that can be used as an independent Server to run JSP and Servlets. It can also be integrated into Apache Web Server. The following describes how to configure Tomcat:
Download the latest version of Tomcat: http://tomcat.apache.org /.
After downloading the installation file, decompress the compressed file to a convenient place, such as C in Windows: \ apache-tomcat-5.5.29 directory or/usr/local/apache-tomcat-5.5.29 directory under Linux/Unix, and then create the CATALINA_HOME environment variable to point to these directories.
On a Windows machine, Tomcat can be started by executing the following command:
% CATALINA_HOME % \ bin \ startup. bat
Or
C: \ apache-tomcat-5.5.29 \ bin \ startup. bat
On Linux/Unix machines, Tomcat can be started by executing the following command:
$ CATALINA_HOME/bin/startup. sh
Or
/Usr/local/apache-tomcat-5.5.29/bin/startup. sh
After Tomcat is started successfully, you can use some web applications that come with Tomcat by accessing http: // localhost: 8080. If everything goes well, you should be able to see the following pages: