我有一個頁面index.jsf,我用ui:include包含頁眉和頁腳,我想在內容中動態查看,這意味着當用戶點擊註冊鏈接時只是內容改變頁眉和頁腳沒有改變如何在一個頁面中創建動態視圖
我像我的代碼示例是:
<ui:include render="#{mybean.include}"/>
和支持豆我的代碼:
public void getInclude(){
if("page" == a){
return "a.jsf";
}
else if("page" == b) {
return "b.jsf";
}
}
,我用漂亮的URL例如 老辦法JSF頁面將顯示網址
http://localhost/index.jsf?page=a or http://localhost/index.jsf?page=b
,但我想用漂亮的網址,而不是舊的方式,例如:
http://localhost/index/a
我怎麼能做到這一點(這意味着使用漂亮的面孔,以及如何我) 我可以在這裏解釋上述問題 而不是以上我使用if(「page」= a)如果我使用舊的方式粘貼參數url http://loalhost/index.jsf?page=a 但如果我使用pretter url或漂亮的臉上什麼我會爲if-else語句做些什麼? 如果(?= A)
2問題,請幫我三江源
==========================================================
現在我成立了漂亮的面孔和很好地工作,但我不知道我怎樣才能從參數Prettyfaces,在漂亮,配置.XML我是配置頁面如下:
主頁(在那裏含量的變化動態)
<url-mapping id="mainpage">
<pattern value="/home" />
<view-id>/faces/main.xhtml</view-id>
</url-mapping>
第1頁
<url-mapping id="mainpage">
<pattern value="/home/#{page:content1}" />
<view-id>/faces/content1.xhtml</view-id>
</url-mapping>
頁2
<url-mapping id="mainpage">
<pattern value="/home/#{page:content2}" />
<view-id>/faces/content2.xhtml</view-id>
</url-mapping>
在一個頁面中我使用的用戶界面:包括動態子視圖
<ui:include src=#{bean.includePage}/>
我的豆已經爲得到一個方法包括頁面
public String getIncludePage(){
if(page == null){
return "content.xhtml";
}
else if (page.equals(content1)){
return "content1.xhtml";
}
else if (page.equals(content2)){
return "content2.xhtml;
}
}
但我無法在一頁中更改動態頁面瀏覽內容
我會回答「使用PrettyFaces」。但你顯然已經意識到這一點。你有什麼問題呢?到目前爲止你做了什麼以及在實現PrettyFaces的同時你在哪一步做了什麼? – BalusC 2010-10-15 10:43:06
嗨Balus我是編輯我的問題,你能幫我嗎?謝謝 – MYE 2010-10-17 04:01:07
請幫助我! :( – MYE 2010-10-17 08:26:15