如何在 sessionScope 变量的基础上添加自定义控件。我尝试包含页面容器控件但没有运气:
<xp:this.afterPageLoad><![CDATA[#{javascript:sessionScope.put("viewName","ccViewAll.xsp");}]]></xp:this.afterPageLoad>
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:sessionScope.get("viewName")}]]></xp:this.value>
</xp:text>
<xc:appLayout>
<xp:this.facets>
<xp:panel xp:key="facetMiddle">
<xp:include id="include1">
<xp:this.pageName><![CDATA[${javascript:sessionScope.get("viewName")}]]>
</xp:this.pageName>
</xp:include>
</xp:panel>
</xp:this.facets>
</xc:appLayout>
上面的代码给了我错误 Error 404 HTTP Web Server: Item Not Found Exception。但是当我硬编码 ccViewAll.xsp 而不是 sessionScope.get("viewName") 的视图名称时,它工作正常。
-麦