0

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.

Jim
  • 3,254
  • 1
  • 19
  • 26
sureone
  • 831
  • 2
  • 14
  • 25

1 Answers1

1

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

Community
  • 1
  • 1
apurvc
  • 740
  • 4
  • 12