Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
OGNL でリクエストロケールを取得する方法を知りたいですか?
今のところ私は使用します
<s:set var="locale" value='#session.WW_TRANS_I18N_LOCALE?#session.WW_TRANS_I18N_LOCALE.toString():"zh_CN"'/>
これは、初期値が「zh_CN」であると想定する必要があります。
そのため、OGNL でリクエスト ロケールを取得する方法を知る必要があります。
どうも
#request.locale
#request.localejava.util.Locale オブジェクトを返す
試す
<s:if test="#request.locale.language=='en'"> Current Locale is ENGLISH </s:if> <s:else test="#request.locale.language=='fr'"> Current Locale is FRANCE </s:else>