Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 EL 2.2中的内部评估_Jsf 2_El - Fatal编程技术网

Jsf 2 EL 2.2中的内部评估

Jsf 2 EL 2.2中的内部评估,jsf-2,el,Jsf 2,El,我有一些代码如下: <f:loadBundle basename="messages.application" var="prop" /> <ui:param name="currentUserAttr" value="#{prop['currentUser']}" /> // currentUserAttr=currentUserVal <h1>Welcome #{sessionScope.currentUserAttr.name}</h1>

我有一些代码如下:

<f:loadBundle basename="messages.application" var="prop" />
<ui:param name="currentUserAttr" value="#{prop['currentUser']}" /> 
// currentUserAttr=currentUserVal
<h1>Welcome #{sessionScope.currentUserAttr.name}</h1> // should be evaludated to sessionScope.currentUserVal.name

//currentUserAttr=currentUserVal
Welcome#{sessionScope.currentUserAttr.name}//应赋值为sessionScope.currentUserVal.name

我想获得
currentUserAttr
的值,然后当从会话读取时,用它的值替换attr,然后从会话获取值,你知道如何在EL 2.2中做到这一点吗?

如果你想使用动态键,也可以使用大括号符号

<h1>Welcome #{sessionScope[currentUserAttr].name}</h1>
Welcome{sessionScope[currentUserAttr].name}