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,224
  • 1
  • 17
  • 26
sureone
  • 801
  • 2
  • 13
  • 23

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
  • 710
  • 4
  • 12