To build a JSP environment under W2K

Source: Internet
Author: User
Tags add variable tomcat tomcat server
JS Environment:
1, operating system: Windows 2000
This example uses the software to download the address:
1, jdk1.2.2
Http://java.sun.com/products/jdk/1.2/
2, Jakarta-tomcat-4.1.exe
http://jakarta.apache.org/builds/tomcat/release/v4.0/

Installation method:

First, install the JDK
The first step is to configure the installation Jdk1.2.2-win.exe, the installation directory is D:\jdk1.2.2
The default installation directory for JRE is D:\Program FILES\JAVASOFT\JRE

Step two, update the environment variables
Start-> Setup-> Control Panel-> System-> Advanced-> Environment variable-> System variable
Variable
New Classpath:d:\jdk1.2.2\lib\tools.jar;d:\jdk1.2.2\lib\dt.jar
Add in Path: D:\jdk1.2.2;d:\jdk1.2.2\bin


Second, the installation of Tomcat
The first step is to extract the Jakarta-tomcat-4.1.exe into the D:\tomcat 4.1 directory
The second step is to enter the D:\tomcat 4.1\bin directory, locate the Setclasspath.bat batch file, and add the following two lines:
Start Set Tomcat_home=d:\tomcat 4.1

Set java_home=d:\jdk1.2.2


Step three, click Start Tombat to start the Tomcat server
At this point, a window named Catalina appears with some initialization information to prove that Tomcat is running successfully.

Step Fourth, enter http://localhost:8080 on the browser
If you can see the Tomcat Version 4.1 page, the Tomcat installation is successful. There are some examples of JSP and servlet, the JSP environment is completed.

Note: Windows Catalina cannot be turned off or the Tomcat server stops service

PS: How to make IT support the servlet:

Add D:\Tomcat 4.1\common\lib\servlet.jar in Classpath

Let's say we write a Congratulate.java

//--------------------------------------

Import needful Package
Import java.io.*;
Import javax.servlet.*;
Import javax.servlet.http.*;

Public class congratulate extends httpservlet{
public void doget (HttpServletRequest request,httpservletresponse response) throws Ioexception,servletexception
{
Response.setcontenttype ("text/html");
PrintWriter Out=response.getwriter ();
Out.println ("Out.println ("<body>");
Out.println ("hello!");
Out.println ("</body>"); Out.println ("Out.flush ();
}
}

//----------------------------------------

Javac Congratulate.java compiled into Congratulate.class

Put the compiled congratulate.class into the example directory web-inf\classes (my root does not have this directory, the new one put inside does not execute! Please contact me qq:78623269 advice!! )

Then open the http://127.0.0.1:8080/examples/servlet/congratulate to run it!

Success!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.