Tomcat under JSP, servlet, and JavaBean environment configuration

Source: Internet
Author: User
Tags tomcat

Often see the JSP novice ask Tomcat How to configure the JSP, servlet and bean issues, so summed up how to configure the JSP, Servlet and Ben, in the hope of helping those beginners.

Step one: Download J2sdk and tomcat: Download J2SDK to the Sun official site ([Url]http://java.sun.com/j2se/1.4.2/download.html[/url]), note that the download version is Windows Offline Installation SDK, it is also best to download j2se 1.4.2 documentation and then to the Tomcat official site ([url]http://www.apache.org/dist/jakarta/ Tomcat-4/[/url]) Download tomcat (Download the latest 4.1.x version of Tomcat);

Step Two: Install and configure your J2SDK and Tomcat: Perform J2SDK and tomcat setup, and then install it by default settings.

1. After installing J2SDK, you need to configure the environment variables to add the following environment variables in My Computer-> properties-> Advanced-> environment variable-> system variable (assuming your j2sdk is installed in c:\j2sdk1.4.2):

java_home=c:\j2sdk1.4.2

Classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (.;;; Must not be less because it represents the current path)

Path=%java_home%\bin

You can then write a simple Java program to test whether the 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 with a file name of Test.java.

Then open the Command Prompt window, the CD to your Test.java directory, and then type the following command

Javac Test.java

Java Test

At this point, if you see the print this are a test program, the installation is successful, if you do not print out this sentence, you need to carefully check your configuration.

2. After installing Tomcat, add the following environment variables in My Computer-> properties-> Advanced-> environment variable-> system variable (assuming your Tomcat is installed in C:\tomcat):

Catalina_home=c:\tomcat;

Catalina_base=c:\tomcat;

Then modify the classpath in the environment variable, add the Servlet.jar under the Tomat installation directory to classpath, and modify Classpath as follows:

Classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;%catalina_home%\common\lib\servlet.jar;

You can then start Tomcat and visit [Url]http://localhost:8080[/url] in IE, and if you see the Tomcat Welcome page, the installation is successful.

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.