我的配置為server: ?port: 8080 ?context-path: /bootuserName: Careypassword: rootcontent: "name: ${userName}, password:${password}"Controller為@RestControllerpublic class HelloController{ ? ?@Value("${userName}") ? ?private String userName; ? ?@Value("${password}") ? ?private String password; ? ?@Value("${content}") ? ?private String content; ? ?@RequestMapping(value="/test", method= RequestMethod.GET) ? ?public String test(){ ? ? ? ?return content; ? ?}}但頁面返回的值中的uerName是lenovo 。。就是我的電腦。。==
添加回答
舉報
0/150
提交
取消