javawicketwicket-6

Is there a way to load string resources from database instead of the wicket properties file?


I need to store the string key value pairs in the database. I want to load them with the Wicket ResourceModel, so no modifications have to be made in the gui part of the application. Is there a way to do that that avoids the overwriting of ComponentStringResourceLoader#loadStringResource() ?


Solution

  • You need to implement IStringResourceLoader that reads from the DB and to register it with getResourceSettings().getStringResourceLoaders().add(new MyDbResourceLoader()) in MyApplication#init() method.