I'm developing JSF 2 web application and using implicit navigation from page to page specifying outcome values and changing url values. I also have some Ajax requests to be able to make changes in some pages without having to submit everything.
My problem comes when, for example, I edit a user's data and save the changes. Managed Bean saves user data and return an String to navigate to the user list. When user is properly saved, a FacesMessage
is added before the action method finishes.
Button
<p:commandButton value="#{msg.UPDATE}" action="#{manager.actionSave}"
ajax="false" />
Code into the method
FacesContext.getCurrentInstance().addMessage(clientId,
new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg));
However, and even I have an <h:messages />
tag in my main page, nothing is displayed there.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…