legacy-knowledge-base
公開されました Sep. 10, 2025

カスタムポートレットからportlet.propertiesのデータを読み込む

written-by

Thanga Meena

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • カスタムポートレットからportlet.propertiesのデータを読み出すには?

Environment

  • Liferay DXP 7.1

解決策

ご注意:以下の手順は、Liferay サポートの範囲を超えたカスタマイズを伴います。 ご利用の際は、適切なご判断をお願いいたします。

  • MVCポートレットを使用したサンプルプラグインの作成
  • モジュールのresourcesフォルダの下にportlet.propertiesファイルを作成し、プロパティを定義します。
  • 以下のように、getメソッドでConfigurationのオブジェクトを使用すると、portlet.propertiesで定義されたプロパティの値を取得することができます。
Configuration configuration = ConfigurationFactoryUtil.getConfiguration(PortalClassLoaderUtil.getClassLoader(), "portlet");

System.out.println("The properties read from the portlet properties ->" +configuration.get("Name_of_the_property"));

did-this-article-resolve-your-issue

legacy-knowledge-base