JSPJava Server Pages introduced by Sun is a dynamic web page development technology executed on the Server, which is based on Java technology. When executing JSP, you need to set up an engine for compiling JSP Web pages on the Web server. You can configure the JSP environment in multiple ways, but the main task is to install and configure the Web server and JSP Engine.
The following uses Tomcat as the JSP Engine and uses Tomcat, Apache, and IIS as the three Web servers to describe how to build a JSP running environment.
I. Introduction to related software
1. J2SDK: the software development tool of Java2, which is the basis of Java applications. JSP is based on Java technology, so you must install J2SDK before configuring the JSP environment.
2. Apache server: a common Web server developed by Apache to provide Web services.
3. Tomcat server: a JSP engine developed by Apache. It has the Web server function and can be used as an independent Web server. However, as a Web server, Tomcat does not process static HTML pages as quickly as Apache, nor is Apache robust. Therefore, we generally use Tomcat with Apache, apache provides services for website static page requests, while Tomcat, as a dedicated JSP Engine, provides JSP parsing for better performance. Tomcat itself is a sub-project of Apache, so Tomcat provides powerful support for Apache. Tomcat is a good choice for beginners.
4. mod_jk.dll: Developed by the Jakarta project team of Apache to support Tomcat plug-ins. With this plug-in, Tomcat can be seamlessly connected to Apache.
5. tc4ntiis.zip: Developed by the Jakarta project team of Apache to enable IIS to support Tomcat plug-ins.
2. Software Download
1. j2sdk
Version: j2sdk1.4.1 (35.9 MB)
Address: http://java.sun.com/j2se/1.4.1/download.html
2. Apache2
Version: Apache2.0.436.69MB)
Address: http://www.apache.inetcosmos.org/dist/httpd/binaries/win32/
3. Tomcat4
Version: 4.1.218.33MB)
Address: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/
4. mod_jk.dll: (136KB)
Address: http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/release/
5366tc4ntiis.zip 220KB)
Address: http://members.ozemail.com.au /~ Lampante/howto/tomcat/iisnt/tc4ntiis.zip
The above are free software.
3. Preparations before configuration
1) Prepare a JSP webpage for testing
Open a text editor, such as Notepad, enter the following code, and save it as test. jsp. Note that the extension is. jsp ).
<HTML> <HEAD> <TITLE> JSP test page </TITLE> </HEAD> <BODY> <% out. println (" |
2) install J2SDK
In either case, you must install J2SDK before installing and configuring the JSP Engine.
1. Install J2SDK
Run the j2sdk-00004_000001-windows-i586.exe file in windows and install it in a directory according to the installation wizard, for example, f: \ j2sdk 1.4.1;
2. Add Environment Variables
1) if your operating system is Win 98, you can use NotePad to directly edit Autoexec. bat and add the following command line:
PATH=%PATH%;f:\j2sdk1.4.1\binSET JAVA_HOME=f:\j2sdk1.4.1SET CLASSPATH=f:\j2sdk1.4.1\lib\tools.jar |
After saving, restart the computer so that the added environment variables will be valid.
2) If your operating system is Win2000, configure the environment variables as follows. Right-click my computer and choose Properties> system features> advanced> environment variables from the shortcut menu. The environment variables dialog box is displayed, you can edit the environment variables of the system. Add three variables: PATH, JAVA_HOME, and CLASSPATH. The variable value is the same as the preceding one.