sp00m sp00m - 1 year ago 76
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?

Answer Source

@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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download