/** リソースバンドル. */
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("app");

/**
* プロパティファイルからキーを元に値を取得する.
* @param key プロパティファイル内で定義したキー名
* @return 値
*/
public static String getStr(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
throw new AppException("app.propertiesに指定したキーがありません。", e);
}

}

相关文章:

  • 2021-11-10
  • 2021-12-09
  • 2021-12-07
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2022-01-10
  • 2021-07-28
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案