【发布时间】:2013-08-05 19:44:31
【问题描述】:
如果代码是这样的,我无法重定向到另一个页面:
<h:commandButton type="button" value="Enter" action="index?faces-redirect=true" >
但如果代码为,则重定向有效:
<h:commandButton type="button" value="Enter" action="index?faces-redirect=true" >
<f:ajax />
</h:commandButton>
谁能解释一下?谢谢!
-----------编辑----------- -
整个xhtml代码供你参考:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form id="form">
<h:commandButton id="enterModelButton" type="button" value="Enter" action="index?faces-redirect=true" >
<f:ajax />
</h:commandButton>
</h:form>
</h:body>
</html>
【问题讨论】:
标签: jsf