我的 h:commandLink 不起作用。我在 faces-config.xml 中有一个导航规则,在我的 bean 中有一个字符串方法 doSave()。我不知道为什么它只重新加载页面而不跳转到 doSave() 方法。
jsf页面
<h:form id="surveyForm">
<div class="srvButton">
<h:commandLink action="#{surveyBean.doSave}" value="#{msg.srvButton}" />
</div>
</h:form>
面孔配置
<navigation-rule>
<from-view-id>/pages/survey.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/pages/surveyFinish.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
豆
public String doSave() {
// Kundendaten speichern
saveCustomer();
return "success";
}
我清理了 jsf 页面中的内容以获得更好的视图,但您需要知道的只是我认为的表单和按钮。