标签:port prope 举例 ica ppi 注解 hello tco server
使用 application.properties 中配置的属性:@Value 注解。
@RestController
public class HelloWorldController {
@Value("${server.port}")
String port;
@RequestMapping(value = "hi")
public String hello(){
return "hello world! I am from " + port;
}
}
使用 application.properties 中配置的属性,举例:@Value("${server.port}")
标签:port prope 举例 ica ppi 注解 hello tco server
原文地址:https://www.cnblogs.com/cag2050/p/11505086.html