Build a jsp environment in win2k

Source: Internet
Author: User

Environment:
1. Operating System: Windows 2000
In this example, the software is used:
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:

1. Install JDK
Step 1: Configure and install jdk1.2.2-win.exe. The installation directory is D: jdk1.2.2.
The default installation directory of JRE is D: Program files0000oftjre.

Step 2: Update Environment Variables
Start> Settings> Control Panel> system> advanced> environment variables> System Variables
Variable
Create CLASSPATH: D: jdk1.2.2libools. jar; D: jdk1.2.2libdt. jar
Add: D: jdk1.2.2; D: jdk1.2.2in to PATH.


Ii. install Tomcat
Step 1: Decompress jakarta-tomcat-4.1.exe to the d: omcat 4.1 directory.
Step 2: Go to the D: omcat 4.1in directory, find the setclasspath. bat batch file, and add the following two lines:
Start set TOMCAT_HOME = D: omcat 4.1

Set JAVA_HOME = D: jdk1.2.2


Step 3: Click start tombat to start the tomcat server
At this time, a window named Catalina appears with some initialization information, proving that tomcat runs successfully.

Step 4: Enter http: // localhost: 8080 in the browser
If you can see the Tomcat Version 4.1 page, it indicates that Tomcat is successfully installed. There are some examples of jsp and servlet, so far the jsp environment has been built.

Note: The Window Catalina cannot be closed; otherwise, the tomcat server stops service.

Ps: how to make it support servlet:

Add D: Tomcat 4.1commonlibservlet.jar to CLASSPATH.

Suppose 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 web-infclasses directory in the example directory (this directory is not available under my root, creating a new one will not be executed! Please contact my QQ: 78623269 !!)

Start http: // 127.0.0.1: 8080/examples/servlet/congratulate and run it!

Successful!

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.