0

I have a problem with session var in sj:head:

<sj:head locale="%{#session.language}" jqueryui="true" jquerytheme="%{#session.viewTheme}" />

Doesn't set either locale or theme. Variables are set properly, line below displays correct values:

selected locale: <s:property value="%{#session.language}"/><br>
selected theme: <s:property value="%{#session.viewTheme}"/>

I played with #session.var %{#session.var} and similar and none of them works. How can I use session vars in sj:head?

4

1 回答 1

0

对于您的主题问题,请尝试以下操作:

主题试试这个:

$(function(){
  $('#jquery_theme_link').attr('href',
                               'struts/themes/'
                               +<s:property value="%{#session.viewTheme}"/>
                               +'/jquery-ui.css');
});

语言环境试试这个:

<sj:head locale="%{#session.locale}"/>

这将注入支柱语言环境。如果你想改变语言环境,你可以使用 struts 改变它,确保

<interceptor-ref name="i18n"/>

在你的堆栈中。

于 2012-09-12T22:24:23.657 回答