【发布时间】:2014-04-21 11:03:20
【问题描述】:
我有很多输入字段,用户必须在其中填写一些数据。完成后,他点击了一个
<p:commandButton widgetVar="submitButton" async="true" value="submit" action="#{bean.storeToDB}" />
public String submit(){
//check if session is invalid:
if(exclusiveTimeHasPassed()){
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("Error", "Your session is not valid anymore. Please reload the page"));
return null; //should stay on the page without losing all data
}
}
现在我在 storeToDB() 的一开始检查“会话”是否同时“超时”(每个用户有 10 分钟的时间来专门进行他的输入)
如果会话超时,他应该收到一条消息 ()(不会丢失他的所有输入),以便显示咆哮消息。
如何实现显示咆哮消息,然后导航案例返回 null(重新加载页面)?
【问题讨论】:
-
这里有什么问题???
标签: jsf primefaces navigation growl