@restcontroller value
时间: 2023-09-27 19:09:30 浏览: 105
在使用Spring框架中的@RestController注解时,可以通过@Value注解来获取配置文件中的值。例如,在一个使用了@RestController注解的类中,可以使用@Value("${FILE_SERVER_URL}")来获取名为FILE_SERVER_URL的配置项的值,并将其赋给一个String类型的变量file_server_url。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [springmvc中的@RequestBody和@RestController、@Value注解.md](https://blog.csdn.net/ouzhuangzhuang/article/details/82877492)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Spring注解 - 52注解 - 原稿笔记](https://download.csdn.net/download/qq_46878411/20929624)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [@RestController当中的value 含义](https://blog.csdn.net/qq_43409111/article/details/123714042)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文