在yml,配置完,調用時 報錯了
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-11-05
舉報
2017-12-10
你的 cupSize、age這兩行前面不要有空格,content需要有一個空格說明是server下面的
2017-11-05
.yml是這個
server:
?port: 80
?cupSize: C
?age: 20
?content: "cupSize:${cupSize},age:${age}"
2017-11-05
.yml
server:
?port: 80
?content: "cupSize:${cupSize},age:${age}"
.java
@RestController
public class HelloController {
// ? ?@Value("${cupSize}")
// ? ?private String cupSize;
// ? ?@Value("${age}")
// ? ?private Integer age;
? ?@Value("${content}")
? ?private String content;
? ?@RequestMapping(value = "/hello")
? ?public String say(){
? ? ? ?return content;
? ?}
}