2.0之前可以通过在配置文件中加入配置server.context-path实现。如: server.context-path=/ 2.0后通过在配置文件中加入配置server.servlet.context-path实现。如: server.servlet.context-path=/