1. Eclipse configures Tomcat1. Select window-preferences as shown in the picture 2. Select runtime environment in server 3. Click add on the right and select your own Tomcat version Please note that the corresponding versions of Tomcat and eclipse are different. The following is what the author saw online. You can consider the details yourself.
4. Then click next, fill in the installation directory according to your own installation directory, and keep the default name and jre 5. Then finish and apply. The project has not been put on Tomcat at this time and still needs to be configured. 6. Create a new dynamic web project, as shown in the figure When creating a project, the target runtime is to select the server. With the previous operation, you can select the server we configured, otherwise it can only be null 7. Then click next, next, and then check to create the web.xml file. Here I changed the content directory to content. The created directory will be different, but it will not affect the Tomcat configuration. Just finish it when you are done. 8. Then select according to the picture This interface appears 9. Double-click the blue font, the next interface pops up, select your project, and click add After adding, just finish. 10. After writing the web project, right-click the blue text in the figure and select start to start the Tomcat service. 2. Solution to invalid port in TomcatWhen Tomcat starts the service, the following problem often occurs. After some investigation, I found that the problem is that there are multiple ports or the port number is occupied. There are several solutions: Method 1:1. Select the server.xml file in the servers on the left and double-click to open it. 2. Click source in the lower left corner of the file 3. Change the port number here to 8888 Then start the service, the service can be started Method 2:1. Find the bin file of Tomcat and find the file in it After clicking it, you will find that the service is running. Click Stop to stop it, and then confirm. ——> The reason is that the local server is started in the bin directory, a copy of Tomcat is copied in Eclipse, and the Tomcat integrated server is started during runtime, so the port number is occupied. Method 3:Find the file under conf in the downloaded Tomcat and edit its port number to prevent port number conflicts. This method is similar to method 1. It should be noted that a copy of Tomcat is made in Eclipse. The modification here only changes the port number of the local server, and does not change the port number of Tomcat in Eclipse. It needs to be reconfigured to be successful. I feel that the modification mentioned online here cannot be successful for this reason. Reconfiguration is tedious, but there is a simple way to do this: 1. Double-click the blue sentence 2. You can see that the server path is not the path of the downloaded Tomcat, which proves that a copy of Tomcat is indeed copied in Eclipse. 3. Click the second one in server locations (use Tomcat installa). This option will associate the server in Eclipse with the local server, and then you only need to change one. But it should be noted that it needs to be modified before the service is started and cannot be modified after it is started. I cannot modify it now. This is the end of this article about eclipse configuration of Tomcat and the solution to invalid port in Tomcat. For more relevant content about eclipse configuration of Tomcat invalid port, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Pure CSS custom multi-line ellipsis problem (from principle to implementation)
>>: A screenshot demo based on canvas in html
Table of contents 1. Principle Overview Query Cac...
Table of contents 1. Installation 2. Introduction...
1 QPS calculation (number of queries per second) ...
You may have set a MySQL password just now, but f...
1 Start the Docker service First you need to know...
This article shares the specific code of vue unia...
Our veteran predecessors have written countless c...
Some common statements for viewing transactions a...
Table of contents introduce Example Summarize int...
Usage: date [options]... [+format] or: date [-u|-...
When displaying long data in HTML, you can cut off...
How to achieve internationalization in React? The...
When we make a form, we often set a submit button ...
1. Introduction to TypeScript The previous articl...
Primitive values -> primitive types Number S...