Я не могу перенаправить на другую страницу, если код выглядит следующим образом:
<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>
Может ли кто-нибудь объяснить это? Спасибо!
----------------------- ----------------------- EDIT -
Весь код 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>