讓JSF 1.2兩頁(one.xhtml和other.xhtml),
由以下規則包含到當前頁面:JSF 1.2:界面:包括與參數
...
<c:if test="#{flowScope.Bean.param1}">
<ui:include src="one.xhtml"/>
</c:if>
<c:if test="#{!flowScope.Bean.param1}">
<ui:include src="other.xhtml"/>
</c:if>
...
據one.xhtml
不同於other.xhtml
只能通過動作參數:
one.xhtml:<h:commandLink action="actionOne">
other.xhtml:<h:commandLink action="actionTwo">
是否有可能使用一些一般XHTML?
代替one.xhtml和other.xhtml,這樣的事情:
...
<c:if test="#{flowScope.Bean.param1}">
<ui:include src="general.xhtml" param="actionOne"/>
</c:if>
<c:if test="#{!flowScope.Bean.param1}">
<ui:include src="general.xhtml" param="actionTwo"/>
</c:if>
...
謝謝你的幫助。
感謝,我KHOW約CC,他們是偉大的,但在目前的jsf 1.2項目不能使用它們。我會嘗試你的解決方案並寫回結果。 – sergionni 2011-03-13 17:53:05
它將基於您在問題中提出的方式工作。但是,如果您使用'#{bean.doSomething}'而不是'actionOne',那麼您確實需要獲取JSF 2.0複合組件。 – BalusC 2011-03-13 18:04:55
奇怪的是,它拋出:action =「#{action}」:身份'action'爲空,無法調用 – sergionni 2011-03-13 18:06:33