2010-11-23 54 views
0

我是JSF的新手。 我想要的是点击某物,当我想要运行一个bean方法并发送GET请求时,我可以设置将在下一页的URL上显示的参数。JSF 1:执行bean方法并为下一页设置参数

我这个导航规则尝试,该方法将执行并返回“success_selectedUserToCard”,它将转发我-view-id的,但参数被删除:

<navigation-rule> 
    <navigation-case> 
     <from-outcome>success_selectedUserToCard</from-outcome>--> 
     <to-view-id>/jspx/user_to_card.faces?tab=usertocard&amp;selectedLink=usertocardManagementLink</to-view-id> 
    </navigation-case> 
</navigation-rule> 

所以我在下面的网址页面将仅为:/jspx/user_to_card.faces

PS我正在使用JSF 1.不能移动到JSF 2

回答

0

改为使用ExternalContext#redirect()

public void submit() { 
    // Do your job here. 
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); 
    externalContext.redirect("/jspx/user_to_card.faces?tab=usertocard&amp;selectedLink=usertocardManagementLink"); 
} 

讨厌的,但因为你没有使用JSF 2.0,支持includeViewParams,没有别的办法。

相关问题