戦争以外で Struts 2 アプリケーションのリソース バンドルをオーバーライドしようとしていますが、うまくいかないようです。ResourceControl
オーバーライドする独自のカスタムを作成しました
newBundle (Loading from my custom location)
、getTimeToLive (with my own interval)
およびneedsReload
メソッド。
リソース バンドルは、スタンドアロン アプリケーションの Struts2 の外部で適切に機能します。Struts2 で ServletContextListener の impl に自分のバンドルを登録しようとしました
public void contextInitialized(ServletContextEvent arg0) {
ResourceBundle bundle = ResourceBundle.getBundle("myresources", defaultLocale,new MyControl());
LocalizedTextUtil.setDelegatedClassLoader(bundle.getClass().getClassLoader());
}
目的は、特定の間隔でバンドルを更新し、再起動せずにアプリケーションに新しいラベルをロードすることです。
質問/問題は、カスタム バンドルを登録して更新できないということです。
ありがとう!