I'm looking to define /api
as the root context for all my @RestController
s and don't want to specify it for each of them.
For instance, I would like to write @RestController("/clients")
instead of @RestController("/api/clients")
and make my request mappings available at /api/clients
but have my static resources (in /main/resources/static
) still served at /**
.
So, setting server.servlet.contextPath=/api
in application.properties
is not a solution for my use case because the static resources will be served at /api
, which I don't want.
In brief, I would like to have the same feature as JAX-RS @ApplicationPath("/api")
in Spring Web MVC, is this possible?