Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to use multiple base request paths in Spring. One way to inform Spring about which one to use when making a request is by using RequestMappingHandlerMapping's setBaseUrl method. This method allows you to set a base URL for the request mappings defined in your application. When a request is made, Spring will use the specified base URL to determine which controller and method to route the request to. Alternatively, you can create separate controller classes for each base URL and annotate them with @RequestMapping to define the paths for each specific controller.