In Spring Boot, an application property can be defined in application.properties file. For example, a prefix of Rest can be defined as
spring.data.rest.baseP
After trying dozens of time how to handle the problem I finally figured out how to make it work. Maybe it will be useful for somebody.
To use prefix for controllers (let's say for example jh
) we need to use server.servlet.context-path
and not spring.data.rest.basePath
.
Link to documentation https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
So application.yml
should looks like this:
server:
servlet:
context-path: /jh
session:
cookie:
http-only: true