0

I want to update the application.properties when i login the application.

  public class DemoApplication {
   @Value("${spring.application.webServer}")
   private String webServer;
   public static void main(String[] args) {
      SpringApplication.run(DemoApplication.class, args);
   }
   @RequestMapping("/setProperty")
   public String webServer() {
      return webServer;
   }
}

I want to set the application.properties while calling setProperty endpoint.is it possible to do with spring boot!

  • Why? What problem are you trying to solve? https://en.wikipedia.org/wiki/XY_problem – Alan Hay Sep 20 '19 at 14:47
  • You can use lot of different sources for spring-boot options (application.properties, command line options, environment values etc) but they are always something which is not changeable in time of application is running. Why do you need that? – Alexey Usharovski Sep 20 '19 at 14:47
  • Possible duplicate of [How can I reload properties file in Spring 4 using annotations?](https://stackoverflow.com/questions/26150527/how-can-i-reload-properties-file-in-spring-4-using-annotations) – Aniket Sahrawat Sep 20 '19 at 15:00

0 Answers0