有没有办法从数据库而不是 wicket 属性文件加载字符串资源?

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

我需要将字符串键值对存储在数据库中。我想用 Wicket ResourceModel 加载它们,因此不必在应用程序的 gui 部分进行任何修改。有没有办法避免覆盖 ComponentStringResourceLoader#loadStringResource() ?

您需要实现从数据库读取的 IStringResourceLoader 并在 MyApplication#init() 方法中使用 getResourceSettings().getStringResourceLoaders().add(new MyDbResourceLoader()) 注册它。