Saturday, August 2, 2008

Java runtime maximize form and closed methods example

In fact, this was originally the basis of a java-related topics, but since it was raised, we might as well say a few words, the way also can be used as a reference for beginners.

/ / 1. Maximize form startup
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;
Import javax.swing.UIManager;

Public class Frame1 extends WindowAdapter (
Public Frame1 () (
Frame f = new Frame ();
F.addWindowListener (this); / / f Frame1 set to deal with the incident
Dimension screenSize = Toolkit.getDefaultToolkit (). GetScreenSize () / / by the size of the screen
F.setLocation (0, 0);
F.setSize (screenSize.width, screenSize.height) / / set form the size of the size of the screen
F.setVisible (true);
)

Public static void main (String [] args) (
New Frame1 ();
)

Public void windowClosing (WindowEvent e) (
System.exit (0);
)
)

/ / 2. Closed form in the six methods
/ / 2.1. Use the enableEvents JFrame and processWindowEvent
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;
Import javax.swing .*;

Public class Frame1 extends JFrame (
Public Frame1 () (
EnableEvents (AWTEvent.WINDOW_EVENT_MASK);
This.setSize (new Dimension (400, 300));
This.setTitle ( "Frame1");
)

Protected void processWindowEvent (WindowEvent e) (
Super.processWindowEvent (e);
If (e.getID () == WindowEvent.WINDOW_CLOSING) (
System.exit (0);
)
)
)

/ / 2.2. Interface directly to WindowListener
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;

Public class Frame1 extends Frame implements WindowListener (
Public Frame1 () (
This.setSize (new Dimension (400, 300));
This.setTitle ( "Frame1");
This.addWindowListener (this);
)

Public void windowClosing (WindowEvent windowEvent) (
System.exit (0);
)
Public void windowOpened (WindowEvent windowEvent) ()
Public void windowClosed (WindowEvent windowEvent) ()
Public void windowIconified (WindowEvent windowEvent) ()
Public void windowDeiconified (WindowEvent windowEvent) ()
Public void windowActivated (WindowEvent windowEvent) ()
Public void windowDeactivated (WindowEvent windowEvent) ()
)

/ / 2.3. Directly inherited form adapter WindowAdapter
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;

Public class Frame1 extends WindowAdapter (
Public Frame1 () (
Frame f = new Frame ();
F.setSize (new Dimension (400, 300));
F.setTitle ( "Frame1");
F.addWindowListener (this);
F.setVisible (true);
)
Public static void main (String [] s) (
New Frame1 ();
)
Public void windowClosing (WindowEvent windowEvent) (
System.exit (0);
)
)

/ / 2.4. Indirectly inherited form adapter WindowAdapter
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;

Public class Frame1 extends Frame (
Public Frame1 () (
This.setSize (new Dimension (400, 300));
This.setTitle ( "Frame1");
This.addWindowListener (new winAdapter ());
This.setVisible (true);
)
Public static void main (String [] s) (
New Frame1 ();
)
)
(Class winAdapter extends WindowAdapter
Public void windowClosing (WindowEvent windowEvent) (
System.exit (0);
)
)

/ / 2.5. Indirectly achieve WindowListener Interface
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;

Public class Frame1 extends Frame (
Public Frame1 () (
This.setSize (new Dimension (400, 300));
This.setTitle ( "Frame1");
This.addWindowListener (new winEventHandle ());
This.setVisible (true);
)
Public static void main (String [] s) (
New Frame1 ();
)
)
(Class winEventHandle implements WindowListener
Public void windowClosing (WindowEvent windowEvent) (
System.exit (0);
)
Public void windowOpened (WindowEvent windowEvent) ()
Public void windowClosed (WindowEvent windowEvent) ()
Public void windowIconified (WindowEvent windowEvent) ()
Public void windowDeiconified (WindowEvent windowEvent) ()
Public void windowActivated (WindowEvent windowEvent) ()
Public void windowDeactivated (WindowEvent windowEvent) ()
)

/ / 2.6. Use Inner Class
/ / Frame1.java

Import java.awt .*;
Import java.awt.event .*;

(Public class Frame1
Public Frame1 () (
Frame f = new Frame ();
F.addWindowListener (new WindowAdapter () (
Public void windowClosing (WindowEvent e) (
System.exit (0);
)
));
F.setSize (new Dimension (400, 300));
F.setVisible (true);
)

Public static void main (String [] s) (
New Frame1 ();
)
)

. NET Framework's Common Language Runtime

. NET Framework's Common Language Runtime Runtime

CLR?

Mentioned in the previous operation. NET Framework in the code called managed code, contrary called unmanaged code. Compared to unmanaged code, managed code has a lot of advantages, for example, can be used to prepare a variety of programming languages, increase security, version control and procedures easy release, and so on. These are provided by the CLR. But there are also some negative points, the code is easy to think of the speed problem.

To provide for the function of managed code, the code must know CLR data types, classes and she connected with the definition of assembly. This information is called metadata, and metadata contained in the code of a certain part (compiled). CLR use of the metadata loading code segment, memory management, and methods of implementation, such as call operation.

. NET out before, in different programming languages shared between the original code, it is impossible. Every programming language because the definition of different data types, and different syntax. Microsoft masters thought of the data types a good way to reunification. The technology called CTS (common type system). Development projects are now on the relatively simple (in different languages), for example, a project team will use VB, there are and will be using C + +. Previously possible way is to call between the two functions written or COM DLL. But now no such trouble, and you can direct the use of other languages of the code. Specifically, using VB.NET can inherit C + +. NET writing category, in turn, is possible.

We install the software often encountered when such tips - components in the system than to install the new components, you should be retained or replaced? It is so disgusting? ! Now you start with. NET bar, she would not because of this "small" problem and disturb you. Because every code contains the metadata associated with her, and CLR will be the basis of this information to manage different versions of the code. And because the code information not registered to the registry, you can use the X-COPY installed code (as simple as pasting a copy).

Using VB is doing a good job? Still do a good job with C + +? The problem is that we do these projects often time to consider the issue. But. NET programming language with what has become a less important (but still have some differences in specific projects), as provided CLR CTS (and base class library), and above all running on the CLR. In. NET VB, C + + and other languages are quite a lot of increase, and a new language C #. C # application of the standard and has been passed, we can imagine the POWE her. We all know that borland also issued a related development tools C # builder.

Be a Summary

N. NET code contains its own relevant information called metadata.

N CLR provide CTS (CLS also credits), in different programming languages can be shared between the original code.

N using metadata management code information (instead of using the registry), the code is easy to install.

N use a unified data type and class libraries, it becomes the choice of programming language is not important, and easy to team development.

CLR code in the operation process

N compiler options

First choice CLR compiler, as CLR can run in different languages developed code.

N the code compiled into MSIL

Choice of using CLR compiler generated MSIL (Microsoft intermediate language) and metadata to their load to PE (portable executable file).

MSIL: Interpretation language, the code contains information to enable easy JIT compiler into machine language. And unrelated to the operating system and programming language.

PE: executable file format, windows is a DLL or EXE.

N with JIT compiler to MSIL compiled into machine language

There are two ways a compiler is the only current implementation of the code segment, and the other is a one-time code to the compiler. JIT will test the safety of the code.

N code execution

Calling will be the first time the code into machine code compiler, again when it is no longer called re-compiled.

Related tools

- MSIL generator - MSIL Assembler (ilasm.exe)

- MSIL anti-Compiler - MSIL Assembler (ildasm.exe)

Use Act

Http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconmsilassemblerilasmexe.asp

Related information

- PE structure

Hello, World!

Then use the same javac HelloWorld.java to compile this document, if there is no import javax.servlet .*
So that should be C: \ Tomcat \ common \ lib inside servlet.jar copy files to the C: \ JDK \ jre \ lib \ ext, again compiled, there will be no problem!
Tomcat then the directory C: \ Tomcat \ webapps \ ROOT inside the file structure as follows:
ROOT \ index.html
ROOT \ welcom.jsp
ROOT \ WEB-INF \ lib \ MyServlet.jar (If your servlet's. Fight a class. Jar file, on the lib below)
ROOT \ WEB-INF \ classes \ HelloWorld.class (HelloWorld.class the above documents generated on the inside)

Then enter http://localhost:8080/servlet/HelloWorld browser, the popular will and therefore Server error: Error 404 - Not Found
How all?
Servlet must use the C: \ Tomcat \ webapps \ ROOT \ WEB-INF directory of the following web.xml file registration with the EP open web.xml file,
On the inside to join

HelloWorld
HelloWorld


HelloWorld
/ Servlet / helloworld

This structure

HelloWorld
HelloWorld

That the designation includes servlet class.
And the following structure

HelloWorld
/ Servlet / HelloWorld

HelloServlet that should be designated where a URL mapping mode.
After revising the web.xml finished, restart Server, and then enter http://localhost:8080/servlet/HelloWorld, then lined a Hello, World! Waiting for you? Congratulate you get the:)
Amat, a tired hands, wrote on it here, it is hoped that role for beginners!

How kind runtime environment configuration JSP

Abstract: how kind runtime environment configuration JSP

How kind runtime environment configuration JSP

First, download tools:
I suggest that beginners use JDK Editplus +, I think that if we use such as JB, Eclipse, JCreator, although just at the beginning of more convenient, but it does lead to beginners do not know how the door configuration environment variable,
Thus making it difficult to know these, know why they are so the state can be downloaded from the following address:
Editplus (the latest version is v2.11): http://count.skycn.com/softdown.php?id=3641&url=http://sc-http.skycn.net/down/epp211a_cn.exe (as a registration key to find it on their own, many of the Internet)
JDK (the latest version is Java2sdk1_4_2): http://count.skycn.com/softdown.php?id=3116&url=http://sc-http.skycn.net/down/j2sdk-1_4_2-windows-i586.exe ( This is For Windows)

Then JDK is installed, I installed it to the c: \ JDK directory:
CLASSPATH then is the problem:
As the operating system use PATH to search executable programs, the Java runtime environment will be to find Ergodic CLASSPATH category, even HelloWorld such a simple procedure, will traverse JVM
CLASSPATH definition of each path, until you find the corresponding documentation so far.
We believe that the systems in use is not 2 k XP, and then on the Path should be set up as follows:
My computer -> Properties -> High -> environment variables and then the Path environment variable behind Supplementary: C: \ JDK \ bin;. C: \ JDK \ lib
This configuration can be: C: \ JDK \ bin;. C: \ JDK \ lib \ dt.jar; C: \ JDK \ lib \ tools.jar
รข˜… Remember: in the environment variable. Remember not less, it said that the current path, but less if the mistakes, and so will say!
Dt.jar is on the operating environment of class libraries, tools tools.jar is on the Class if there is no configuration: C: \ JDK \ bin, will be a "javac 'is not an internal or external command, it can not run the program or batch file. "Such a mistake.
Then write the procedures below:
The first is (HelloWorld.java), opened Editplus, a new Java files, in keeping with the following input, the word not to leak, and to distinguish between upper and lower case:
Public class HelloWorld (
Public static void main (String [] args) (
System.out.println ( "Hello, World!");
)
)
This then save the file (ctrl + s) to HelloWorld.java, we must remember to distinguish between upper and lower case, is not helloworld.java HelloWorld.java or other Below the running start -> run -> cmd
In the console switch to the directory in the current directory:
Javac HelloWorld.java
Java HelloWorld
You will see the console output Hello, World! (No? I eat a computer:))
Javac compiler is an order it to compile into HelloWorld.class HelloWorld.java
Java is explained orders, the HelloWorld.class explained JVM implementation.
At this time:
1. If there Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
It is in your environment variables that did not add. (Dot)
2. If there Exception in thread "main" java.lang.NoSuchMethodError: main
Or HelloWorld.java: 1: Public class helloworld must be defined in a file called

"HelloWorld.java."
That is, you do not have to distinguish between upper and lower case writing this HelloWorld, or preserved for the time did not keep HelloWorld.java
The name will follow the same public class names

For the problem of environment variables Here, I first say how Below Editplus inside the building and operation of the Tools-> Settings -> configuration user tools
1. Add tools (add applications)
Menu text: Compile Java Program
Procedure: C: \ JDK \ bin \ javac.exe
Parameters: the initial directory file name: document directory
2. Add tools (add applications)
Menu text: Run Java Program
Procedure: C: \ JDK \ bin \ java.exe
Parameters: the file name (without extension)
Initial Catalog: file directory

Tool name can easily add, for example, Debug Java Program
Then in the Tools pull-down menu, you will see Compile Java Program Run Java Program, as well as the two options, since you can use a ctrl + compiler and the operational procedures ctrl +2


Below Servlet discussion on the Run:
Servlet first run, the need for JSP / Servlet container, I suggest that beginners use Tomcat
Tomcat (the latest version 5.0): http://cvs.apache.org/builds/jakarta-tomcat-5/nightly/jakarta-tomcat-5-bin-20030725.zip
Then extract the compressed to:
C: \ Tomcat
Then configuration environment variable:
Add three systems variables:
JAVA_HOME: C: \ JDK
TOMCAT_HOME: C: \ Tomcat
CLASSPATH:% JAVA_HOME% \ lib;% TOMCAT_HOME% \ lib
Tomcat environment variables on the configuration finished, the following test Tomcat whether to run:
In the console to the C: \ Tomcat \ bin directory of this, the startup operation, and then back to the emergence of a window, and even a long jump things, and finally said Server has been running in the browser input http://localhost:8080, a welcome interface , it will be no problem for the Tomcat, and then above, write your first Servlet
Import java.io. *;
Import javax.servlet .*;
Import javax.servlet.http .*;
Public class HelloWorld extends HttpServlet
(
Public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
(

Response.setContentType ( "text / html");
PrintWriter out = response.getWriter ();
Out.println ( " ");
Out.println ( "

Set JSP development, runtime environment

Abstract: Setting JSP development and runtime environment

Servlet and JSP 2.1 installation development tools

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.

2.2 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. For details, please see http://newatlanta.com/.


Gefion the LiteWebServer (LWS)

LWS is a support Servlet 2.2 and JSP 1.1 free small Web server. Gefion WAICoolRunner there is a free plug-in, using the plug-in for Netscape FastTrack and Enterprise Server 2.2 increase Servlet and JSP 1.1 support. For details, please see http://www.gefionsoftware.com/.


Sun's Java Web Server.

The servers all use Java languages, and is the first to provide Servlet 2.1 and JSP 1.0 specification support of the integrity of the Web server. Although Sun now has shifted to Netscape / I-Planet Server no longer develop Java Web Server, but it is still a popular Servlet and JSP learning platform. To receive a free trial version, please visit http://www.sun.com/software/jwebserver/try/.

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:
……