I have a springboot application where I have used two types of controllers for apis:
- Jersey controller using
@Path("/v1/test")
and@Service
combination - Spring Rest Controller using
@RequestMapping(value = "/xyz/")
and@RestController
combination
I have kept jersey application path as blank spring.jersey.application-path=
Whenever I try to reach to /xyz uri, it is giving me 404 not found error. It tries to look for the uri under all jersey resources and if it doesn't find it there, it gives 404 not found error.
I have tried two things:
- I tried to give some random path to jersey application path like below: spring.jersey.application-path=abc In this case it is able to distinguish between two types of controllers so I was able to reach to /abc/v1/test as well as /xyz
- I created /xyz in jersey controller and deleted it from spring rest controller, and I have kept jersey application path as blank. In this case also I am able to reach to both the apis.
But I want neither of the options. How can I configure springboot so that if any resources are not found in jersey controller, it should look for spring rest controller and I can still keep spring.jersey.application-path property blank.