Tomcat for eclipse

Source: Internet
Author: User

Java1.7.0 _ 01 + eclipse3.7.1 + tomcat7.0.23

1. Install the development environment.

Install JDK, Eclipse IDE for Java EE developers, tomcat7.0.23

For configuration convenience, install the eclipse Java EE version. Tomcat uses the Windows Installation Package.

The installation directory is as follows:

Eclipse> D: \ developer \ eclipse

Tomcat> D: \ developer \ Tomcat 7.0

Java> C: \ Program Files \ Java \ jdk1.7.0 _ 01

2. Eclipse configuration.

For basic installation and configuration, see the reference. Here we only focus on some problems that are easy to ignore.

2.1 Add a server. There is a small icon in the lower left corner of eclipse to open the servers view.

Add a new server.

Select the Tomcat v7.0 server version and configure the server. Click "Configure runtime environments" to further configure the Tomcat directory, for example:

If the purpose of development debugging is to direct the development site to the tomcat installation directory, You need to specify the following configuration.

When adding a server, or after adding a server (double-click the server), configure the server before adding a site.

The deploy path in the figure below is wtpwebapps, but the actual Tomcat path is webapps. To change the development environment and actual environment result to webapps.

3. Create a dynamic web project's Java EE Project.

4. Configure the site to the server.

Select the server you just added and click "add and remove..." to select the site to be configured.

Because "If server is started, publish changes immediately" is selected, ifCodeIf the servlet code is changed, it is automatically compiled and synchronized to the tomcat installation directory.

5. Java EE structure.

The site's HTML content is placed in webcontent, And the Servlet's background code is added to the src directory. eclipse will automatically compile the Java background code upon release, and synchronize the content of webcontent to the directory specified in the newly added server.

6. Simple MVC development.

 

 

Refer:

Installing Tomcat 7 and using it with eclipse

Introduction to MVC

 

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.