Detailed explanation of JSP Server Installation

Source: Internet
Author: User

Every person who comes into contact with the JSP server basically starts from the installation of JSP, because JSP does not have any installation process like ASP, nor does it have an automatic installation package like PHP, JSP installation is troublesome, and there are many manual steps. Here we will explain them step by step:

First, you must download several software: JDK, Apache, and Tomcat. JDK (Java Development Kit) is the basis of all java applications. It can be said that all java applications are built on this. It is a set of APIS, or java Class. I learned the latest version of JDK1.X at that time, and later SUN microelectronics, JAVA's Development Company) suggested using J2RE. Now there are basically many people who use J2EE.

I believe everyone has heard that JAVA is very portable and can be applied to various system platforms. Therefore, many enterprises have built JSP on LINUX for cost or security considerations, some veteran Technicians believe that LINUX + TOMCAT + APACHE is a perfect WEB platform, however, I think we should also consider that there are not many developers working in LINUX and the development is more difficult than the WINDOWS platform, and the development efficiency is greatly limited, therefore, the cost for building the WEB on the LINUX platform is also very high in terms of development and maintenance in the future, so I will talk about how to install JSP in WIN2000.

I. JDK or J2EE Installation

Download JDK

You can go to SUN's official website to download JDK or J2EE. The usage is similar. Here we take JDK as an example to explain: java.sun.com, there are many places in China.
Run the. exe file in windows and install it in a directory, such as C: jdk.

Configuration System

Select "my computer" on the desktop, right-click "advanced" and choose "environment variable,
Click "new" in "system variables"
Enter CLASSPATH in the variable name, and enter the following in the variable value:
C: JDKLIBdt. JAR; C: JDKLIBTOOLS. JAR; C: JDKBIN
After the configuration is complete, restart the computer and the environment variables will take effect.

Test

(1) Use a text editor to write a simple java program:

 
 
  1. public class HelloWorld {  
  2. public static void main(String args[]) {  
  3. System.out.println("Hello World!");  
  4. }  

This example is the famous "Hello World". Its function is to display "Hello World ".
Note: The file name must be "HelloWorld. java", which is case sensitive.

(2) Compile: Execute at the doscommand prompt: Case Sensitive)
Javac HelloWorld. java
If normal, the HelloWorld. class file will be generated.
(3) Run: Execute at the doscommand prompt: Case Sensitive)
Java HelloWorld
Well, running java HelloWorld should have a great "Hello World.

In this step, you have successfully configured the JDK, but the JDK cannot execute web scripts, and you have to install Tomcat again.

Ii. install Tomcat

Tomcat is a good choice for beginners to execute JSP and Servlet. Tomcat is a product of the Apache organization, and sun's support for it is also quite good.

Download

JAVA official site: jakarta.apache.org, which is also widely used in China.
Download: http://jakarta.apache.org/builds/tomcat/release/ from this address
After the download, decompress the package to a directory and use C: Tomcat as an example.

JSP server configuration

Select "my computer" on the desktop, right-click "advanced", and choose "environment variables". In "system variables", click "new", enter JAVA_HOME in the variable name, and enter "C:" In the variable value: JDK and then confirm;
In "system variables", click "new", enter "TOMCAT_HOME" in the variable name, enter "C: Tomcat" in the variable value, and click "OK;
Okay. After the configuration is complete, the environment variable will be valid only after the computer is restarted.
Note that other Tomcat settings can be left unchanged if necessary. If you are not sure about your changes, do not change them.

Test

(1) start tomcat:
In C: Tomcat in, there is a: startup. bat. Run it and a Dos window will appear.

(2) browsing
Enter http: // localhost: 8080/in the browser to check the effect. (the default Tomcat port is 8080. You can change it without conflict ), you should see a kitten or tiger.

(3) Run
On this page, JSP Examples and Servlet Examples are available. Now, test and run them on your own.

(4) Exit tomcat
In C: Tomcat in, there is shutdown. bat. Running it will close the Dos window, but I usually close it directly ).

OK. If you just want to create a JSP server, it will be OK. If you want to add the database function, then install and configure a MYSQL instance or use JDBC to access other databases that meet the open standards.

  1. Analysis on CGI supported by jsp http Server
  2. Use JSP pages to generate PDF reports
  3. Step for customizing JSP labels
  4. Detailed test of JSP containers
  5. Describes the following features of jsp http Server

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.