1. Background
With many years of Tomcat, regardless of the development environment or production environment, it should be said that we are basically satisfied with it. But it's not a problem. From a developer's point of view, the main disadvantage of Tomcat is the weak thermal deployment (hot deploy) capability. To modify a Java class, after saving, Tomcat will reload the class, but will soon restart Tomcat to continue development. In the Enterprise key application scenario, if the urgent bug correction, so that a large number of users to stop the work at hand, waiting for the server to restart, obviously very inconvenient.
Similar to the rubyonrails of the technical framework, its convenience is that the scripting language does not compile, save directly can be used. The Java community clearly sees this problem, and the GlassFish V2 's thermal deployment capability is one of its main popular features. This is also the main reason why we want to replace Tomcat 5.x with GlassFish v2.
2. Use of the environment
This article assumes that you use the development environment described below.
(1) JDK 1.5 or 1.6
(2) Eclipse IDE for Java EE developers (3.3.1.1 m20071023-1652)
(3) Using com.sysdeo.eclipse.tomcat_3.2.1 plugin
If you are not using the Eclipse 3.3.1.1 Java EE version, you are using a different version, and you do not affect all the actions and effects described in this article, but you cannot start and stop GlassFish v2 with Eclipse, you can only operate from the command line.
For detailed instructions on operating GlassFish v2 with the eclipse 3.3.1.1 Java EE version, see Eclipse 3.3 and GlassFish Java EE 5 integration.
3. Download and install GlassFish v2
This information is already very easy to find from the Internet, the better article is as follows:
(1) deploying Web applications on GlassFish
(2) GlassFish Preliminary examination
(3) from Tomcat to Glashfish (GlassFish installation start notes)
4. Create Tomcat Project
I'm sure you know how to create a Tomcat project. This article assumes that you created the TOMCAT project:
(1) Located in the D:/sample directory.
(2) The context name is Sample.
Others take the default setting.