Windows Server 2003 configures the Tomcat JSP runtime Environment __JS

Source: Internet
Author: User
The previous system has been equipped with JSP's operating environment, then Google came to some information, today, the process of their own record down.
1. Development environment Configuration
1.1 Download Java SDK and Tomcat
Javase SDK download page: http://java.sun.com/javase/downloads/index.jsp;
Tomcat download page: http://tomcat.apache.org/;
Installation and configuration of 1.2 Javasdk,tomcat
Perform the installation of JDK and Tomcat, and then install by default settings.
1.2.1 After installing the JDK, you need to configure the environment variables to add the following environment variables in My Computer->-> Advanced-> environment variable-> System variable (assuming your JDK is installed in F:/program files/java/jdk1.6.0):
  
Java_home=f:/program files/java/jdk1.6.0
Classpath=.; %java_home%/lib;%java_home%/lib/dt.jar;%java_home%/lib/tools.jar; (.;;; Must not be less because it represents the current path)
setting of PATH variable: Add the following after the current path variable:
;%java_home%/bin (be careful not to delete the original content)

You can then write a simple Java program to test whether the JDK has been installed successfully:
  
Class Hello
{
public static void Main (string[] args)
{
System.out.println ("Hello world! Test me! ");
}

}

Saves the above program as a file with a file name of Hello.java.

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

Javac hello.java
java Hello

If you see it printed right now, Hello W orld! Test me! If the installation is successful, if you do not print out this sentence, you need to carefully check your configuration.

1.2.2. Install Tomcat
I am installing Apache-tomcat-5.5.20.exe
General Software Installation like this, here I install in F:/program files/apache Software Foundation/tomcat 5.5
This version of TOMCAT does not create environment variables;
There are data requirements to create environment variables:
in turn, My Computer-> properties-> Advanced-> environment variable (N)-> new
Variable name: tomcat_home, variable value is C:/Program files/tomcat5.5  The

then modifies the classpath in the environment variable, tomat the Common/lib under the installation directory (which can be appended to the actual append) Servlet.jar to Classpath, and the modified classpath is as follows:

.; %java_home%/lib;%java_home%/lib/dt.jar;%java_home%/lib/tools.jar;%tomcat_home%/common/lib/servlet.jar; 

You can then start Tomcat, run Tomcat,f:/program files/apache Software foundation/tomcat 5.5/bin/tomcat5.exe
You can then enter it in the browser: http://localhost:8080 can see the default page for Tomcat.
Write first JSP program

<%@ page contenttype= "text/html;charset=gb2312"%>
<%@ page language= "java"%>
<title> First JSP program </title>
<body>
<%out.println ("Hello world!"); %>
</body>

Create a new directory under the WebApps directory, called MyApps;
Save it to F:/program Files/apache Software foundation/tomcat 5.5/webapps/myapps/hello.jsp

Then you can enter http://localhost:8080/myapps/hello.jsp in the browser to a Web page,
Output on this page:
Hello World.

If not, you can try: http://127.0.0.1:8080/myapps/hello.jsp,
That should be it.

Here is an example of how the current system time will be displayed:

<%@ page contenttype= "text/html;charset=gb2312"%>
<%@ page language= "java"%>
<title> Current system Time </title>
<body>
<%= new Java.util.Date ()%>
</body>

Transferred from "http://www.cnblogs.com/welland/archive/2007/01/24/629412.html"

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.