Configuration of JSP, Servlet, and JavaBean environments in Tomcat

Source: Internet
Author: User
I often see jsp beginners asking how to configure jsp, servlet, and bean in tomcat. So I summarized how to configure jsp, servlet, and ben in tomcat, hoping to help beginners.
Step 1: Download j2sdk and tomcat: to the sun official site (http://java.sun.com/j2se/1.4.2/download.html) download j2sdk, pay attention to download the version of Windows Offline Installation SDK, at the same time it is best to download J2SE 1.4.2 Documentation, then go to the tomcat official site (http://www.apache.org/dist/jakarta/tomcat-4/) to download tomcat (download the latest version of tomcat 4.1.x );
Step 2: install and configure your j2sdk and tomcat: execute the j2sdk and tomcat installation programs and install them according to the default settings.
1. after installing j2sdk, you need to configure the environment variables, choose my computer> Properties> Advanced> environment variables> System variables to add the following environment variables (assuming your j2sdk is installed in c: j2sdk1.4.2 ):
JAVA_HOME = c: j2sdk1.4.2
Classpath =.; % JAVA_HOME % libdt. jar; % JAVA_HOME % libools. jar; (.; must not be less, because it represents the current path)
Path = % JAVA_HOME % in
Then, you can write a simple java program to test whether J2SDK has been installed successfully:
Public class Test {
Public static void main (String args []) {
System. out. println ("This is a test program .");
}
}
Save the above program as a file named Test. java.
Then open the command prompt window, cd to the directory where your Test. java is located, and then type the following command
Javac Test. java
Java Test
If This is a test program is printed, the installation is successful. If This is not printed, you need to carefully check your configuration.
2. after Tomcat is installed, add the following environment variables to my computer> Properties> Advanced> environment variables> System variables (assuming your tomcat is installed in c: omcat ):
CATALINA_HOME = c: omcat;
CATALINA_BASE = c: omcat;
Modify the classpath in the environment variable and append the servlet. jar under commonlib under the tomat installation directory to the classpath. The modified classpath is as follows:
Classpath =.; % JAVA_HOME % libdt. jar; % JAVA_HOME % libools. jar; % CATALINA_HOME % commonlibservlet. jar;
Start tomcat and access http: // localhost: 8080 in IE. If you see the welcome page of tomcat, the installation is successful.
Step 3: Create your own jsp app Directory
1. Go to the webapps Directory of the Tomcat installation directory, and you can see the tomcat built-in directories such as ROOT, examples, and Tomcat-docs;
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.