如何在 Spring-Boot 中传递字符串值@RequestMapping("/test")
。
我想将String str ="/test"
作为RequestMapping(str)
中的字符串值传递,请建议如何读取请求映射中的字符串值。
最佳答案
这应该有效
@RequestMapping("${test.string.value}")
和您的 application.properties/yaml
test.str.value =/test
关于Spring Boot如何在@requestMapping中传递配置/动态url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37134050/