1

I am trying to implement a simple database configuration editor (to change host, port, user, etc.), but after saving the /WEB-INF/classes/server.properties file, changes do not seem to be recognized (the old configuration is still there when I access the built-in database configuration page). How can I tell SmartGWT to reload the database configuration?

BLuFeNiX
  • 2,496
  • 2
  • 20
  • 40

2 Answers2

1

Usually Application reads properties at sturtup and sets theese properties to java objects. So if you are changing properties during your application lifetime you need to take care about rereading them after your change and recreating (refreshing) objects that use them.

For more specific example please provide some code.

nkukhar
  • 1,975
  • 2
  • 18
  • 37
  • I don't think my question needs example code to be answered. Even editing /WEB-INF/classes/server.properties with a text editor will cause the described behavior. I just need to know how to tell SmartGWT to reload this file. – BLuFeNiX Jun 05 '13 at 16:15
1

You can use the Config class to do this. Simply call the following static method to reload the global config.

Config.initGlobalConfig();

See http://www.smartclient.com/smartgwtee-latest/server/javadoc/com/isomorphic/base/Config.html for more information.

Daniel
  • 131
  • 2
  • 5