Current location - Quotes Website - Team slogan - Java gets tomcat port number
Java gets tomcat port number
You start tomcat, use your computer as a server, and then allow external network access.

If a local area network is established, the local computer (PC running Java Web service) and the client (who wants to access Java Web service) must be in the same local area network, for example, both of them are connected to the same wireless router.

Deploy the project to Tomcat, start it, and check the IPv4 address of WLAN through ipconfig command on the command line. On the client, just enter: HTTP://ipv4 address: 8080/ project name http:/192.168.1.1065438: 80. You can also change the port number to 80 in Tomcat's configuration file, and change the default project name to the project you want others to visit, so that you can access it directly through the IP address, such as http:/192.168.1.

If the external network is connected in this way, it is recommended that the notebook be directly connected to the network cable. The default notebook will be directly connected to the external network cable below.

This method is very simple. You can know the external IP of this machine directly by searching for IP in Baidu, which is the IP address assigned to you by ISP. Just enter: HTTP:// local IP:8080/ project name in the client, in this case: http://210.41.98.6438+050. You can also change the port number to 80 in the configuration file of Tomcat, and change the default project name to the project you want others to visit, so that you can access it directly through the IP address, such as http://210.41.98.150.