JSP + Tomcat configuration - written to rookie friends who are anxious because of configuration issues

zhaozj2021-02-16  50

This article is not written to the JSP master, but it is like me as a rookie, in order to solve the friends who are as anxious to be equivalent to confuting, now I want to write all my experience, and everyone Common progress:

Before I do it, my system is Win2000, there is no other, my purpose is to write a simple JSP page and then read in the browser and is Chinese content.

Need to download a few software: 1. Microsoft Win2000 service pack (no) 2. Java's SDK is also called JDK (Java's development environment) (must) 3.Tomcat (required to do web) )

Then to configure Java's JDK and Tomcat's specific steps as follows: 1:. My computer's properties -> Advanced -> Variable Environment -> We need new system variables (a total of four):

1. Variable name Add: "Path" Variables Add: "Your JDK installation directory / bin": My installation directory is "c: /sun/j2eesdk1.4_beta2/jdk/bin" 2. Variable name Adjoubting: "ClassPath" variable value is added (note quotation marks are not filled, there must be a small dot in front, add the following to the variable planting, and use the semicolon to set off, see below, for Convenient to see a lot of lines): "You install directory /lib/tools.jar; your installation directory /dt.jar; your installation directory / bin; your Tomcat installation directory / common / classes; Your Tomcat installation directory / common / lib; your Tomcat installation directory /common/lib/servlet-api.jar; "3. Variable name Add" java_home ", value," Your installation directory ", for example, my installation The directory is: "c: /s/j2eesdk1.4_beta2/jdk" 4. Variable name Add "Tomcat_Home" (note, uppercase), value added "You Tomcat installation directory", for example, my installation directory is "c: /tomcat/jakarta-tomcat-5.0.14"

Second, configure Tomcat's execution file (.bat): First enter the Tomcat installation directory, find the bin folder, enter the bin and then find the startup.bat file, pay attention, some versions may be different, but the name is always Startup before the name. Click Right-click -> Edit. Open this text, then look for start letters, usually in the end, we only need to add: set tomcat_home = You Tomcat installation directory SET JAVA_HOME = Your JDK installation directory (for example, I What is: c: /sun/j2eesdk1.4_beta2/jdk) Set classpath = You JDK installation directory /dt.jar set classpath = your Tomcat installation directory /common/lib/servet-api.jar This step is the main purpose To be, in execution .jsp file is, the Tomcat server can automatically find some Java environment and environment, etc. ...

Ok, the first step and the second step we have completed, the configuration of the system environment variable, and the configuration of Tomcat, there is another problem, that is, set the problem of the virtual directory, why set the virtual directory? Because When we put an address on your browser, we are different from the actual directory of the file. We must set up, the virtual directory will automatically find the actual directory according to our settings.

The configuration virtual directory is mainly configured to configure the server.xml file in the CONF folder under Tomcat. After entering, we open this .xml file in text, (Method is: Select the file, then hold down Shift Right-click, look for "Open Mode", we open in text. You can use Notepad's lookup function, (under Edit menu) Find "" Add like this before this Code (PATH is a virtual directory, and DOCBASE is the actual physical directory): < / Context> Ok, we must not forget to save. The following thing is obvious, we have to build a Yuan's folder under D. I wrote a webpage name "index.jsp", then we You can write http: // localhost: 8080 / yuan in the address bar of the browser, we can see this page, then everyone will continue to edit it.

Edited Tools We can choose Homesite this software is relatively small, it is very suitable for JSP development

If you don't understand, you can send it, yuanetking@yahoo.com.cn

转载请注明原文地址:https://www.9cbs.com/read-24345.html

New Post(0)