Reputation: 28
While starting my Spring MVC war I need to specify the mode. Based on mode it should start different set of controllers. Is it possible to do the same by specifying mode/ applicable controllers while starting it?
A similar question Spring MVC web application - enabling / disabling controller from property only talks of test but I need to have various combinations and start all controllers as default.
Upvotes: 1
Views: 127
Reputation: 28569
Spring in general has a profile mechanism that lets you register different beans in different environments
When you bootstrap it according to doc, distinguishing controllers is as simple as annotating them on a class level with e.g. @Profile("mode1")
vs @Profile("mode2")
Upvotes: 3