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