Saturday, August 2, 2008

How to configure Java Server Page runtime environment

Abstract: How to configure Java Server Page runtime environment

NT installed JSP

Windows NT 4.0, Windows 2000 professional, windows 2000 server
Jdk1_2_2-001-win.exe
Tomcat.zip (3.0)

First, download the software JDK
Http://java.sun.com/products/jdk/1.2/
Tomcat
Http://jakarta.apache.org/builds/tomcat/release/v3.0/tomcat.zip

Second, the software is installed (a) JDK
1, double-click jdk1_2_2-001-win.exe document installation, the default configuration installed JDK the default installation directory is C: jdk1.2.
2, JRE default installation directory is C: Program FilesJavaSoftJRE1.2;
3, restart the computer;
4, the following update environmental variables: the C: directory jdk1.2.2 in additional to the PATH; the C: jdk1.2.2libools.jar; C: jdk1.2.2libdt.jar joined in the CLASSPATH.
Update: Control Panel -> -> environment -> System Variables;
(B) Tomcat
1, such as using WinZIP decompress tomcat.zip software to decompress to a directory, I decompress it to the C:, it will automatically create tomcat subdirectories, so that C was more of a directory on the C: / tomcat, I use the logo TOMCAT $ 3, modify Tomcat running of the port, to Tomcat to have a separate HTTP server, it must be used not to use a port, I have here the 8081 has not yet been occupied, I used $ TOMCAT_PORT logo, allocated to the Tomcat: 1) Open $ TOMCAT / server.xml; 2) Revise ContextManager: 4, double click on the directory $ TOMCAT startup.bat to start Tomcat 5 in the browser enter http://localhost: $ TOMCAT_PORT /, Tomcat Version 3.0 can see on this page that Tomcat installation is successful;

Set JSP development and runtime environment

Abstract: JSWDK installed, you should tell javac, when the document was compiled Where to find Servlet and JSP category. JSWDK Installation Guide of this detailed description, but the main servlet.jar and jsp.jar is to join the CLASSPATH.

To learn Servlet and JSP development, first of all, you must be prepared to comply with a Java Servlet 2.1/2.2 and JavaServer Pages1.0/1.1 standardized development environment. Sun provides free JavaServer Web Development Kit (JSWDK) can be downloaded from http://java.sun.com/products/servlet/.

JSWDK installed, you should tell javac, when the document was compiled Where to find Servlet and JSP category. JSWDK Installation Guide of this detailed description, but the main servlet.jar and jsp.jar is to join the CLASSPATH. CLASSPATH instructions Java is a class how to find the document environment variables, if we do not set CLASSPATH, Java standards in the current directory and find the system; If you set up a CLASSPATH, do not forget that includes the current directory (that is, in the CLASSPATH contains. " ").

Furthermore, in order to prevent and other developers to the same Web server installed on a naming conflict Servlet best to pack their own Servlet Add inside. At this time, the packets in the top-level directory structure also joined CLASSPATH will bring a lot of convenience. Please see below specify.

Installation support Servlet Web server

In addition to developing tools, you want to support the installation of a Java Servlet Web server, or in the existing installed on the Web server Servlet package. If you are using the latest Web server or application server, it may already have all the necessary software. Please check the Web server document, or visit http://java.sun.com/products/servlet/industry.html Show support Servlet server software inventory.

Although the final run Servlet is always business-class servers, but when the study began, with a desktop machine can run on the free system development and testing are adequate. Below are some of the most popular products.

Apache Tomcat.

Tomcat Servlet 2.2 and the JSP 1.1 specifications to achieve the official reference. Tomcat can separate small Servlet and JSP test server, but also can be integrated into the Apache Web server. Until early 2000, the Tomcat is the only support Servlet 2.2 and JSP 1.1 specifications of the server, but there have been many other servers that provide support in this respect. Apache Tomcat and the same is free of charge. However, the rapid, steady, the Apache server installation and configuration with a little trouble, the Tomcat also has the same shortcomings. And other business-class Servlet engine compared to the workload of Tomcat configuration, it must more. For details, please see http://jakarta.apache.org/.

JavaServer Web Development Kit (JSWDK).

JSWDK is Servlet 2.1 and JSP 1.0 achieve the official reference. The Servlet and JSP application deployment to the formal operation of their servers, JSWDK can separate small Servlet, JSP test server. JSWDK is also free, and has good stability, but its installation and configuration also more complex. For details, please see http://java.sun.com/products/servlet/download.html.

Allaire JRun.

JRun is a Servlet and JSP engine, it can be integrated into Netscape Enterprise or FastTrack Server, IIS, Microsoft Personal Web Server, version lower Apache, the WebSite O'eilly or StarNine Web STAR. Supports up to five concurrent connections restricted version is free of charge, does not exist in the commercial version of this restriction, and increased remote management console such functions. For details, please see http://www.allaire.com/products/jrun/.

The New Atlanta ServletExec

ServletExec is a fast Servlet and JSP engine, it can be integrated into the most popular Web server platform includes support for Solaris, Windows, MacOS, HP-UX and Linux. ServletExec free to download and use, but many advanced features and management tools only in the purchase of a license can be used only after. New Atlanta also offers a free Servlet debugger, the debugger can be in many popular Java IDE work.

Jsp under Windows runtime environment configuration

Configuration before the preparatory work:

Name names install software download Address
J2sdk j2sdk-1_4_2-windows-i586.exe http://java.sun.com/
Jakarta-Tomcat jakarta-tomcat-5.0.28.zip http://jakarta.apache.org/
Apache-Tomcat

J2sdk the installation and configuration:

1. Computer I / Properties / Advanced / system environment variables / path
And "E: \ j2sdk1.4.2 \ bin";

2. Computer I / Properties / Advanced / system environment variables / JAVA_HOME
And "E: \ j2sdk1.4.2";

3. Computer I / Properties / Advanced / system environment variables / classpath
And "E: \ j2sdk1.4.2 \ lib \ dt.jar; d: \ j2sdk142 \ lib \ tools.jar; d: \ j2sdk142 \ lib;.";
Attention behind that point, it said that the current directory, the directory contains, we can go to any directory needed for the implementation of a directory of the Java programming;

4. Type javac command prompt, there are parameters that suggested that the successful installation.

Tomcat installation and configuration:

1. Will jakarta-tomcat-5.0.28.zip decompress the file E: \ directory tomcat

2. Computer I / Properties / Advanced / system environment variables / TOMCAT_HOME
And "E: \ tomcat";

3. Computer I / Properties / Advanced / system environment variables / CATALINA_HOME
And "E: \ tomcat";

4. Start tomcat: Go to the "D: \ TomCat \ jakarta-tomcat-5.0.5 \ bin \" Double-click startup.bat start Tomcat directory services (double-click shutdown.bat closed Tomcat services);

5. Input http://localhost:8080 a Tomcat welcome the interface;

6. Inspection environment variable configuration:
Prepared with a notepad time.jsp
<% @ Page contentType = "text / html; charset = GB2312"%>
<% @ Page import = "java.util .*"%>
  


Now is the time:
<% Date date = new Date (); %>
<= Date%%>


The time.jsp stored in the document: E: \ tomcat \ webapps \ ROOT directory, enter http://localhost:8080/time.jsp
Occur:
Now is the time: XXXXXXXX (your computer on the current time)
Tomcat configuration so successful.

Tomcat oracle9i default port and conflict resolution:

The first open oracle imports of services will oralce http://localhost:8080 the Oracle Servlet Engine pages.

A revised tomcat port:

In E: \ tomcat \ conf \ server.xml found:
……