Advertisement

Spring Boot2.0配置访问虚拟路径

阅读量:

描述

复制代码
    Spring Boot2.0更新重构了很多代码。
    在之前虚拟路径是server.context-path=xxx
    而更新后改为了server.servlet.context-path=xxx
    (更新以后server不在仅有servlet了,还添加了很多其他的)
    
    
      
      
      
      
    

方法

复制代码
    # server
    server.port=8080
    server.servlet.context-path=/chatroom
    
    
      
      
      
    

在项目启动控制台中能够观察到

复制代码
    [           main] o.s.m.s.b.SimpleBrokerMessageHandler     : Started.
    [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path '/chatroom'
    [           main] xyz.c

全部评论 (0)

还没有任何评论哟~