JS configuration Eclpise+tomcat and implementation of JSP writing and deployment
The title of this graduation thesis is the research of key frame feature extraction algorithm, it needs a demo, it should be built on Web service system and JSP dynamic page as interface. After consideration, decide to use the now very popular Java development platform Eclipse and compare Tomcat Server as a development tool. However, the configuration and use of these two software is not as easy as that of a commercial Java IDE like Jbulider, and there are not many Chinese books on the configuration method. After a period of exploration, as well as on the internet to collect data, many times the practice, and finally the two software configuration succeeded, and the implementation of a simple JSP dynamic page of the compilation and deployment, for the future of the system to create conditions. The specific process is now recorded as follows (the software version installed below is the newer or more stable version today):
A Download
J2SDK Download
Http://java.sun.com/j2se/1.4.2/download.html
Download version is j2sdk-1_4_2_08
Eclipse Downloads
http://www.eclipse.org/downloads/index.php
Download version is Eclipse-sdk-3.0.2-win32
Tomcat download
http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi
Download version is jakarta-tomcat-5.0.28
Two Installation
1. Install J2SDK First
I install the path is: D:\Program files\java\j2sdk
2. Install Eclipse again
Eclipse is green software and does not need to be installed, unzip the downloaded Eclipse compression pack.
The path I install is: D:\Program files\java\eclipse
3. Install Tomcat
Download back is a setup file, follow the installation prompts to do it
The path I install is: D:\Program files\java\tomcat
4. Install Eclipse Plugin
Chinese bag
Extract the contents of the features and plugins two folders directly from the compressed package into a folder with the same name in the Eclipse folder Nlpack-eclipse-sdk-3.0.x-win32
Tomcat Plug-in
Unzip the compressed package tomcatPluginV3 and unzip the contents of the Plugins folder into the folder with the same name in the Eclipse folder.
Three Environment configuration
1. System environment Variable Configuration
Right-click My Computer-> advanced-> environment variable,
Set the Java_home variable to point to its installed directory "D:\Program FILES\JAVA\J2SDK";
The tomcat_home variable points to its installed directory "D:\Program Files\java\tomcat";
The path variable contains "%JAVA_HOME%\BIN;" ;
Classpath variables contain "%JAVA_HOME%\LIB\TOOLS.JAR;" ;
2. Configuration of the Java Runtime Environment in eclipse
In the Eclipse main window, the Windows-> Preferences->java-> the installed JRE, select the J2SDK that we have installed
3. Configure the Sysdeo Tomcat plugin
In the Eclipse Main window, window-> preference->tomcat,tomcat version version 5.x (our version installed), Tomcat home fills us with the path of Tomcat installation, this is D:\ Program Files\java\tomcat.
Switch to the advanced option, and then fill in the Tomcat base where we install Tomcat, which is D:\Program files\java\tomcat.
Switch to the JVM setting option to make sure the JRE is the J2SDK version you have installed, and we choose J2SDK here.
Switch to Tomcat manger App to add a user to the admin interface.
Finally press the Apply button and then in the OK.
Check that the configuration is successful simply by pressing the Tomcat button in the Eclipse main window and then typing http://localhost:8080 in the address bar in the browser, which proves that the configuration was successful if the Tomcat page appears.
Four Writing Programs
1. Create a Tomcat project
Right-click the space in the Package Explorer window, create a new->tomcat project, fill in the name of the project in the project name, and here I'll fill in the Tomcat_test and click "Finish".
2. Create a JSP page
In Package Explorer, right-click "Tomcat_test", create a new-> file, fill in the file name helloworld.jsp (the extension cannot be missing), and enter the following code in the Text editing window:
<body>
</body>
and then save.
3. Click the "Run Tomcat" button
4. If everything works, enter http://localhost:8080/tomcat_test/HelloWorld.jsp in the browser window
The browser will show "Hello World"
Five Deploying JSP Pages
The deployment here is a simpler approach: first, copy the Tomcat_test directory of Eclipse's Workpalce directory to the WebApps directory in the Tomcat directory, and then edit the Server.xml in the Conf directory, Before </engin>, add the following host element:
Unpackwars= "true" autodeploy= "true" >
</Host>
Then save, then start Tomcat, so as long as you enter http://*.*.*.*:8080/tomcat_test/helloworld.jsp in the browser window
The browser will show "Hello World"
This means that your JSP page deployment is successful, others will be able to access your page online
(PS:*. *.*.* refers to the host IP address on which the Tomcat server is installed)
Six A few notes
(1) Select J2sdk instead of JRE because the J2SDK has a Java running environment and a class that the Java program needs, and the JRE has only a running environment.
(2) because the software itself upgrades more frequently, often need to reset the use of the environment variables or reconfiguration, such as the JDK version from 1.3 to 1.4, that is, the JDK directory name may be changed from "j2sdk1.3" to "j2sdk1.4", if so, Eclipse may not be able to start again (it looks for the java_home variable from the environment variable, and the Java_home variable value has changed from "j2sdk1.3" to "j2sdk1.4"). Similarly, jakarta-tomcat This software upgrade is more frequent, now with Eclipse to use Tomcat, then each Tomcat upgrade, you may have to reset the Tomcat installation directory in eclipse. If we follow the traditional installation method, we have to set up or configure the software every time, this is very troublesome. For this type of problem, the solution is simple, as long as the default software installation directory name to remove the version number (if you worry about forgetting the version number, just add a Readme file in the directory to explain it). This approach is used in the installation process described above.
(3) The above description is to refer to some books and a lot of online data, and through their own practice last recorded, there may be a lot of deficiencies, hope to teach, and thank those who published information on the Internet masters, from their article I benefited a lot ah.
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.