Learn SpringBoot fragmentary records - Configuration Application URL name

Learn SpringBoot configure the application name, and found that pit

To find online 

https://blog.csdn.net/qq_40087415/article/details/82497668

server:
  port:8088
  context-path:/springboot-demo

Actually, in my SpringBoot of 2.2.2.RELEASE, the compiler is not passed;

I later discovered the practice:

YAML configure the application name

 

server:
  port: 8082
  servlet:
    context-path: /study

Compiled by the log is as follows

 

2020-01-02 22:23:28.851  INFO 5532 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-01-02 22:23:28.851  INFO 5532 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-01-02 22:23:28.991  INFO 5532 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/study]  : Initializing Spring embedded WebApplicationContext
2020-01-02 22:23:28.991  INFO 5532 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1596 ms
2020-01-02 22:23:29.334  INFO 5532 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-01-02 22:23:29.662  INFO 5532 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8082 (http) with context path '/study'
2020-01-02 22:23:29.678  INFO 5532 --- [           main] com.gaole.study.StudyApplication         : Started StudyApplication in 3.554 seconds (JVM running for 5.242)

It is estimated that the cause is not the same version SpringBoot

Guess you like

Origin www.cnblogs.com/alexgl2008/p/12142419.html