ECLIPSE+TOMCAT Integrated Development servlet

Source: Internet
Author: User
Tags zip tomcat
Servlet ECLIPSE+TOMCAT integrated Development servlet keywords Eclipse Tomcat is an integrated development environment for open source, which is supported by IBM, and Tomcat we are more familiar with, It is the Jsp/servlet container for the Apache organization, and the following describes how to integrate: Preparation: 1. Tomcat4.0 2. Jdk1.4 3. Eclipse2.0 4. Eclipse's Tomcat plugin is installed in Http://www.sysdeo.com/eclipse/tomcatPluginV2.zip: 1. Install jdk1.4 2. Install Tomcat4.0 3. Install Eclipse2.0, decompression can be 4. Unzip the Tomcatpluginv2.zip and copy the Com.sysdeo.eclipse.tomcat folder to the plugins directory in the Eclipse installation directory. Configuration: 1. Start Eclipse 2. Open Menu Windows->preferences 3. Select Tomcat on the left, and you can see some form 4 on the right. Tomcat version chooses version 4.0.x,tomcat home to select the Tomcat installation path, and Configuration file automatically fills in the Tomcat profile Server.xml 5. Expand the Tomcat menu on the left, select JVM Settings,jre Select Detected VM, 6. Press Apply 7. Press OK 8. Look at your toolbar is not a few more kittens icon, if not, select the menu Windows->custmize Perspective, expand the other option, tick on Tomcat, OK, see the Kitten's icon did not. 9. Try the Start Tomcat button, OK, and Tomcat starts up in the console. Example: Below makes a Hello world example of 1. Select File->new->project 2. Select Tomcat Project in the dialog box, then next 3. Enter Project Name, where you can write HelloWorld and continue next 4. Check the can update server.xml file option, Finish, OK, a poject has been created. 5. Open new CLA.SS Wizard, fill in the HelloWorld in name, fill in the Javax.servlet.http.HttpServlet in the superclass, press Finish, OK, a servlet created 6. The Doget method is overloaded in Helloworld.java, the code is as follows: Import Javax.servlet.http.HttpServlet; Import Javax.servlet.http.HttpServlet; Import Javax.servlet.http.HttpServletRequest; Import Javax.servlet.http.HttpServletResponse; Import java.io.IOException; Import Java.io.PrintWriter; Import javax.servlet.ServletException; public class HelloWorld extends HttpServlet {public void doget httpservletrequest request,httpservletresponse response) Throws IOException, servletexception {response.setcontenttype ("text/html"); PrintWriter writer = Response.getwriter (); Writer.println ("Hello world!"); 8.ctrl+s Save, right-click HelloWorld project, select Tomcat project->update context to Server.xml 7. Start Tomcat 9 in Eclipse. Accessing HTTP in Browser ://localhost:8080/helloworld/servlet/helloworld 10. Did you see HelloWorld?

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.