4

I have a Spring Boot application with multiple controllers in a single package. I would like to prepend "/api/" to all @RequestMapping paths and am assuming it is possible to do so in one place. I can't change server.contextPath because I have other things that need to be served from the root context.

Is it possible to do something like this using controller advice?

Any guidance is appreciated.

1 Answer 1

0

It sounds like you are trying to inherit the request mapping (at least some part of it) on each of your controllers. Checkout this answer for a good code sample: How to inherit RequestMappings in a Spring 3 MVC REST API .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.