I have setup the property server.servlet.context-path=/xyz
in the application.properties file so all my endpoint have a prefix of /xyz. Now, I want to create an endpoint that should not have /xyz as the prefix(as an exceptional scenario). How can I achieve that?
Asked
Active
Viewed 5,205 times
6

Neelabh
- 63
- 1
- 4
1 Answers
5
Technically it is not possible because spring boot has only one DispatcherServlet
which is a front controller, if you want two different paths then you can use @RequestMapping
annotation on two different controllers`
Still of you want two different context-paths
then you should have two DispatcherServlet's

Ryuzaki L
- 37,302
- 12
- 68
- 98
-
Thanks. Is there a way to configure two `DispatcherServlets` in the same app? – Neelabh Sep 21 '18 at 03:30
-
i believe perfect place for you https://stackoverflow.com/questions/29096511/using-multiple-dispatcher-servlets-web-contexts-with-spring-boot – Ryuzaki L Sep 21 '18 at 03:32