[英]How to add navigation to backing bean
一個簡單的問題,但不記得如何做到最好。 我想要的是在運行代碼段后自動將用戶發送到另一頁"/lecturer/marking/marking-section-two"
。
有沒有辦法在支持bean中執行此操作,不會影響之前顯示的ajax消息?
這是我正在運行的代碼
public void markSectionOne() {
//supposing the data in markSectionOne is filled...
this.markingFacade.create(markSectionOne);
this.setMessage("Mark Saved");
//after saving...
markSectionOne = new Marking();
// now navigating to the next page
}
一旦它運行,我想自動導航到一個新的頁面。
多謝你們
您可以更改方法以返回將被解釋為下一個導航結果的String。
public String markSectionOne() {
// ... unrelevant code
return "/lecturer/marking/marking-section-two";
}
如果該方法返回null
,則JSF將保持在同一頁面上。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.