How to start the spring boot port

Spring boot boot port

Spring boot is integrated into the web container by default. The startup method is started by the main function entry like ordinary Java programs. The built-in Tomcat container or jetty container depends on the configuration (default Tomcat). Of course, you can also package the project into a war package and put it into a separate web container (tomcat, Weblogic, etc.). Of course, you need to make simple adjustments to the program entry before that.

Spring boot is a good thing. It can be started directly in the main method without a container, and there is no configuration file. It is convenient to build the environment quickly. However, when we want to start two springboot projects at the same time, there will be a problem. It is possible that the second application cannot start because port 8080 is occupied by the first application. At this time, we need to modify the startup port of one project.

This can be achieved by implementing the embeddedservletcontainercustomizer interface:

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>