WebServerFactoryCustomizer set the port, address, error pages etc.

package com.ioc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;

/**
 * Created by zhangshukang.
 */

@SpringBootApplication
public class CircularSpringBootApplication implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {



    public static void main(String[] args) {
        SpringApplication.run(CircularSpringBootApplication.class);
    }

    @Override
    public void customize(ConfigurableServletWebServerFactory factory) {
        factory.setPort(9999);
    }
}

 

posted @ 2019-10-28 11:27  tonggc1668  阅读(390)  评论(0编辑  收藏  举报