第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

Could not resolve placeholder 'cupszie' in value "cupsize: ${cupszie},age: ${age}"

報錯如下:

Error creating bean with name 'helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'cupszie' in value "cupsize: ${cupszie},age: ${age}"


代碼如下:

application.yml代碼

server:
?port: 8081
?context-path: /girl
cupsize: B
age: 20
content: "cupsize: ${cupszie},age: ${age}"

HelloController.class代碼

@RestController
public class HelloController {

? ?@Value("${cupsize}")
? ?private String cupsize;

? ?@Value("${age}")
? ?private Integer age;

? ?@Value("${content}")
? ?private String content;

? ?@RequestMapping(value = "/hello",method = RequestMethod.GET)
? ?public String say(){
? ? ? ?return content;
? ?}
}

代碼跟老師的一樣,請教老師這是為什么呢

正在回答

12 回答

content: "cupsize: ${cupszie},age: ${age}"這個好像是需要空格吧,很嚴格,在,后面空格試試

0 回復 有任何疑惑可以回復我~

? ?@Value("${content}")
? ?private String content;

改成

?@Value("${server.content}")
? ?private String content;

11 回復 有任何疑惑可以回復我~
#1

huizai_2014

貌似不行
2017-07-23 回復 有任何疑惑可以回復我~
首頁上一頁12下一頁尾頁

舉報

0/150
提交
取消
2小時學會Spring Boot
  • 參與學習       151527    人
  • 解答問題       1132    個

Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序

進入課程

Could not resolve placeholder 'cupszie' in value "cupsize: ${cupszie},age: ${age}"

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號