我的配置为
server:
port: 8080
context-path: /boot
userName: Carey
password: root
content: "name: ${userName}, password:${password}"
Controller为
@RestController
public 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 。。就是我的电脑。。==
Carey_Wu
Carey_Wu
相关分类