sp00m sp00m - 7 months ago 27
Java Question

How to version my API with Spring MVC?

For now, URLs of my API are for example:


With Spring MVC:


I would like to version this api:


The best would be to be able to use an SpEL in the
annotation, but it is unfortunately not possible:


What are the other options then?


@RequestMapping resolves from property place holder values. So define a PropertySourcesPlaceHolderConfigurer like below.

<context:property-placeholder location="classpath*:*.properties"/>

Then use the syntax like below.