Skip to content
Advertisement

Pass value with @Value to @RequestParam

So basically I have my rootFolderId in my application.properties

JavaScript

and I need to get it in the Controller

JavaScript

and use it in @RequestParam like :

JavaScript

but I get the problem “Attribute value must be constant” .Is there any way to make it work ?

Advertisement

Answer

You can use property replacement in the @RequestParam field. See below.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement