わかりました、これを行うための 1 つのメカニズムを見つけました - portal-object.xml で新しいポートレット ウィンドウ (ForgotPasswordWindow_de) を作成します。
<window>
<window-name>ForgotPasswordWindow_de</window-name>
<instance-ref>UserMgmtPortletInstance_de</instance-ref>
<region>center</region>
<height>0</height>
</window>
これは、portlet-instances.xml 内の新しいポートレット インスタンス (UserMgmtPortletInstance_de) を指し、同じポートレットを指し、lang プリファレンスが定義されています。
<deployments>
<deployment>
<instance>
<instance-id>UserMgmtPortletInstance</instance-id>
<portlet-ref>UserMgmtPortlet</portlet-ref>
<preferences>
<preference>
<name>lang</name>
<value>en</value>
<read-only>true</read-only>
</preference>
</preferences>
<security-constraint>
<policy-permission>
<unchecked/>
<action-name>view</action-name>
</policy-permission>
</security-constraint>
</instance>
</deployment>
<!-- add new deployment for UserMgmtPortletInstance_de -->
<deployment>
<instance>
<instance-id>UserMgmtPortletInstance_de</instance-id>
<portlet-ref>UserMgmtPortlet</portlet-ref>
<preferences>
<preference>
<name>lang</name>
<value>de</value>
<read-only>true</read-only>
</preference>
</preferences>
<security-constraint>
<policy-permission>
<unchecked/>
<action-name>view</action-name>
</policy-permission>
</security-constraint>
</instance>
</deployment>
</deployments>
次に、ポートレットの doView() コードで、このプリファレンスを見つけて、属性を設定します。
String lang = request.getPreferences().getValue("lang", null);
request.setAttribute("lang", lang);
次に、jsp で属性を確認し、ロケールを設定します。
String locale = (String) request.getAttribute("lang");
すべてを開始するために、ログイン ページにはスイッチがあり、言語がドイツ語の場合、ForgotPasswordWindow_en の代わりに ForgotPasswordWindow_de を呼び出します。