Article From:

One configuration Tomcat

1.Open Eclipse, click the “Window” menu, and select “Preferences” below.

2.Click the “Server” option to select the “Runtime Environments” below. For example, Figure 1-1.

3.Click Add to add Tomcat. as Figure 1-2.

4.Click “Next” to select the Tomcat path you install. For example, figure 1-3.

5.Click “Finish” to complete

Two establish a Web application

  1. File → New → Dynamic Web Project

  2. Create a Dynamic Web Project, as in Figure 2-1.

  3. Click on the next step of “Next”, as in Figure 2-2.

  4. Click on the next step of “Next”, as in Figure 2-3.

  5. Click “Finish” to complete

Three let the Tomcat server display on the console and deploy the Web application to Tomcat.

  1. Window → Show View → Servers ,For example, Figure 3-1.

  2. Click on the link No servers are available. Click ths link to create a new new, select the version in the pop-up dialog box, as shown in Figure 3-2.

  1. Click on “Next” to add our project, as shown in Figure 3-3.

  2. Click “Finish” to complete

Four test

  1. Return to the “Servers” panel below, right click on the “Tomcat v8.0 Server at localhost” node in the panel, and click “Start” in the pop-up shortcut menu to start the specified Web server. If this is straight at this timeWhen you access http://localhost:8080/Test, you will find 404 errors. This is because we did not add the homepage, and add the following contents of the index.jsp.

Note: Web resources must be added to the WebContent directory. For example, Figure 4-1.

  1. Visit the link again: http://localhost:8080/TomcatTest, the effect is shown in Figure 4-2.

Leave a Reply

Your email address will not be published. Required fields are marked *