Is there a way to pull up @RequestMapping path with a path variable from a properties file?

Viewed 85

There is a way to place value of the path attribute of the @RequestMapping annotation in a properties file. For example:

path.status=/status

And use it as follows:

@RequestMapping(path ="${path.status}")
...

How to do this if a path variable is present?

path.status-message=/status/{message_id}
1 Answers

That path pattern added in property file. There is no issue in retrieve that value as follow. RequestMapping(value = @Value("${ path.status-message }"))

Related