Eclipse integrates Tomcat and configuration, and eclipse integrates tomcat
1. In Eclipse integration, click Windows --> Preference --> Server --> RuntimeEnvironment to display the following interface. Click the Add button, select the tomcat version, check createNewLocalServer, and click next to install it in wizard mode.
2. Change the configuration (installation path, release path, etc.) because the integrated tomcat is hosted by eclipse, the default tomcat connection will be blocked by eclipse. When integrated tomcat runs, it is generally not accessible from the browser directly through localhost: 8080. For convenience, You need to modify the tomcat configuration in eclipse as follows:
After tomcat is integrated, Windows --> ShowViews --> Servers will display:
Double-click the server. The configuration dialog box is displayed:
When tomcat integration is installed, ServerLocation-related options can be modified and changed to the figure. Specifically, Tomcat installation and Deploy path are also the webapps path of tomcat. The Port configuration module is available on the right, which can be modified as needed. Generally, the default value is enough.
3. Automatic deployment
Select a JavaDynamicProject, right-click the project, and choose RunAs --> Run on Server. If the project is a new project and has never been automatically deployed by eclipse, the page jumps out:
Select Always use this server when running this project. Then click Next and select "which projects need to be automatically deployed ".
Then click finish to start tomcat for the first time.
After each startup, you only need to click Run on server. When the code changes, stop the server and click Run on Server again to re-automatically deploy and load the project. After the server is started, the eclipse browser automatically jumps out and displays the home page of the project. After the server is restarted, You need to refresh the page to view the updated content.