使用@Value给属性参数赋值
作者:互联网
package com.tszr.controller; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class ValueReaderConfigController { @Value("天生自然") private String msg; @RequestMapping("/testValue") public String testValue() { return msg; } }
标签:RestController,springframework,Value,org,import,赋值,annotation,属性 来源: https://www.cnblogs.com/tszr/p/15965817.html