Where do I put a property that every @Controller can read/access in Spring MVC?
For example, I want to set a flag such as DEBUG_MODE = 1, then read this flag from my code to do something.
Where do I put a property that every @Controller can read/access in Spring MVC?
For example, I want to set a flag such as DEBUG_MODE = 1, then read this flag from my code to do something.
You may use spring @Value annotation and put the property in the properties file check out this question Spring @Value annotation in @Controller class not evaluating to value inside properties file
answer by Boris Treukhov