Configure EclPise + Tomcat and implement JSP writing and deployment

xiaoxiao2021-03-05  53

Configure EclPise Tomcat and implement JSP writing and deployment

The topic of this graduation thesis is the characteristic extraction algorithm for key frames. It needs a demo to establish a web service system and as an interface as a JSP dynamic page. After consideration, decided to use the currently popular Java development platform Eclipse and compare Tomcat servers as the development tool. However, the configuration of these two software is more convenient than commercial Java IDE such as JBulider, and there are not many Chinese books that describe the configuration method. After a period of exploration, as well as online collection information, the practice of multiple times, finally configured these two software configurations, and implemented the writing and deployment of the simple JSP dynamic page, which creates conditions for future systems. Now the specific process is recorded (the software version installed below is now new or stable versions):

One. Download

J2SDK Download

http://java.sun.com/j2se/1.4.2/download.html

The download version is J2SDK-1_4_2_08

Eclipse download

http://www.eclipse.org/downloads/index.php

The download version is Eclipse-SDK-

3.0.2-Win32

Eclipse plugin download

Chinese in the language package:

http://sunsite.informatik.rwth-aachen.de/eclipse/downloads/drops/l-3.0.1_translations-200409161125/nlpack-eclipse-sdk-3.0.x-win32.zip

Tomcat plugin SYSDEO Eclipse Tomcat Launcher Plugin:

http://www.sysdeo.com/eclipse/tomcatpluginv3.zip

Tomcat download

Http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi

The download version is Jakarta-Tomcat-

5.0.28

two. Install

two. Install

1. Install J2SDK first

My installation path is: D: / Program Files / Java / J2SDK

2. Install Eclipse

2. Install Eclipse

Eclipse is green software, no installation, you can decompress the downloaded Eclipse compression package.

The path I installed is: D: / Program Files / Java / Eclipse

3. Install Tomcat

Download back is a installation file, follow the installation prompt.

The path I installed is: D: / Program Files / Java / Tomcat

4. Install the Eclipse plugin

4. Install the Eclipse plugin

Chinese

Differently extract the contents of the compressed package NLPACK-Eclipse-SDK-3.0.x-Win32 in Features and Plugins two folders to the Eclipse folder Features and Plugins two folders.

Tomcat plugin

Unzip the compressed package TomcatPluginv3 and extract the contents of the Plugins folder to the Plugins folder in the Eclipse folder.

three. Environmental configuration

1. System environment variable configuration

Right click on "My Computer" -> Advanced -> Environment Variable,

Set the Java_Home variable to point to the directory "D: / Program Files / Java / J2SDK" installed;

Tomcat_home variable points to its installed directory "D: / Program files / java / tomcat";

The PATH variable contains "% java_home% / bin;";

The ClassPath variable contains "% java_home / lib / Tools.jar;"; 2. Configuration of Java operating environment in Eclipse

2. Configuration of Java Operation Environment in Eclipse

In the Eclipse main window, "Window" -> Preferences -> Java-> installed JRE, choose the J2SDK we have installed

3. Configure the Sysdeo Tomcat plugin

3. Configure the Sysdeo Tomcat plugin

In the Eclipse main window, "Window" -> Preferences -> Tomcat, Tomcat Version Select Version 5.x (we installed version), Tomcat Home is filled in the path to Tomcat, here is D: / Program Files / Java / Tomcat.

Switch to the Advanced option, fill in the path to Tomcat installed at Tomcat Base, here is D: / Program Files / Java / Tomcat.

Switch to the JVM Setting option, determine that JRE is the J2SDK version you have installed, we choose J2SDK here.

Switch to Tomcat Manger App to add a user to the management interface.

Then press the application button and finally determine.

Check if the configuration is successful, just press the Tomcat Run button in the Eclipse main window, then enter http: // localhost: 8080 in the address bar in the browser, if the Tomcat page is displayed, then the configuration is successful.

four. Programming

four. Programming

1. Create a Tomcat project

Right-click on the Blank place in the Package Explorer window, create the name of the project in the project name, here I fill in Tomcat_test, click "Finish".

2. Create a JSP page

2. Create a JSP page

In the package resource manager, right-click "Tomcat_test", create a new-> file, fill in the helpoWorld.jsp (extension cannot be lacking) in the file name, enter the following code in the text editing window:

Hello World

Then save it.

Fives. Deploy JSP page

Fives. Deploy JSP page

Here, I use a relatively simple method: First, copy the Tomcat_test directory of the WorkPalce directory in Eclipse to the WebApps directory under the Tomcat directory, then perform text editing in the confeding server.xml, in Add the following Host element before:

Unpackwars = "true" autodeploy = "true">

Then save, then start Tomcat, as long as you enter: http://*.*.*.*: 8080 / tomcat_test / helloworld.jsp

The browser will display "Hello World".

This shows that your JSP page deployment is successful, others can access your page online.

(Ps: *. *. *. * Means the host IP address of the Tomcat server installed). A few description

six. A few description

(1) Select J2SDK instead of JRE because J2SDK has the class required by Java programs in addition to the Java running environment, while JRE only operates.

(2) Since the software itself is more frequent, it is often necessary to reset the environment variables used or reconfigure, such as the JDK version from

1.3 Upgrade to 1.4, the JDK directory name may be from "J2SDK

1.3 "change to" J2SDK

1.4 ", if this is the case, then Eclipse may not be able to start again (it wants to look for java_home variables from the environment variable, and the java_home variable value has been from" J2SDK)

1.3 "change to" J2SDK

1.4 ", Jakarta-Tomcat this software upgrade is more frequent, now combined with Eclipse to use Tomcat, then each Tomcat upgrade, you may have to reset the Tomcat installation directory in Eclipse. If you follow the traditional installation Method, we have to set or configure each time you upgrade software. This is very troublesome. For this type of problem, the solution is simple, just remove the default software installation directory, you can remove the version number (if you worry about forget the version number, as long as you worry Add a README file to the directory to explain). This method is used in the above installation process.

(3) The above description is to refer to some books and a lot of online information, and have been recorded by their own practice, there may be many shortcomings, I hope to advise, and thank you for the masters who publish information online, from them I am better in the article.

(Note: Please indicate the author CL41)

转载请注明原文地址:https://www.9cbs.com/read-34549.html

New Post(0)