修改Spring boot内置的tomcat端口

介绍两种种简单的修改spring boot内置端口的方法:

第一种:在入口直接设置端口,代码如下所示:

public static void main(String[] args){
        SpringApplication.run(TestSpringBoot.class, "--server.port=9999");
    }

 

第二种:步骤如下:

1、

2、

3、Apply一下重新运行main方法即可访问新端口

 

posted on 2018-01-17 16:32  月笙  阅读(1655)  评论(0编辑  收藏  举报