I have a spring boot application with static content and some controllers.
The application context path is set via server.servlet.contextPath
, the path for the static files is set via spring.mvc.static-path-pattern
. I´m searching for a solution to set the root url for all controllers just like the context path, but without setting the path for the static files too, what the context path configuration does...
Asked
Active
Viewed 3,163 times
2

user3388213
- 41
- 1
- 4
-
So you are saying you want both those properties to be equal to the same value? – Jose Martinez May 08 '18 at 12:09
-
1Possible duplicate of [How to set base url for rest in spring boot?](https://stackoverflow.com/questions/32927937/how-to-set-base-url-for-rest-in-spring-boot) – GolamMazid Sajib May 08 '18 at 12:11
-
This does not seem like a duplicate. – Jose Martinez May 08 '18 at 12:20
-
2@JoseMartinez It is a duplicate, but you interpreted the question in a wrong way. The context path is already applied to the static resources, and the OP doesn't want that. (He wants to be able to set a base path for controllers only, rather than on everything.) – g00glen00b May 08 '18 at 12:21
-
@g00glen00b Got it. Thanks! – Jose Martinez May 08 '18 at 12:23
-
Possible duplicate [Setting Spring REST controllers base url without changing the static resources base url](https://stackoverflow.com/questions/47462267/setting-spring-rest-controllers-base-url-without-changing-the-static-resources-b). – O.Badr May 08 '18 at 14:08