2013-03-06 85 views
3

我有包装PrimeFaces.ajax.AjaxResponse处理ViewExpiredException(重新加载页面):PrimeFaces ViewExpiredException页面重载后

var handleViewExpired = function (viewId) { 
    window.alert('${msg.ajax.viewExpired}'); 
    window.location.reload(); 
}; 

不过,有时我得到的错误一遍又一遍的尝试点击任何东西在网站上调用AJAX请求后:

javax.faces.application.ViewExpiredException: /tree.xhtmlNo saved view state could be found for the view identifier: /tree.xhtml 
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128) 

我在做错误的方式刷新?我应该如何调用整个页面重新加载,例如点击浏览器中的重新加载?我是否需要删除Cookie(JSESSIONID,oam.Flash.RENDERMAP.TOKEN)?

我在运行WebSphere 7.0的MyFaces 2.0.7上使用PrimeFaces 3.5。

+0

请看看这个http://stackoverflow.com/questions/4992526/how-to-handle-session-expiration-and-viewexpiredexception-in-jsf-2 – 2013-03-08 18:18:28

回答

1

如果您在会话中同时打开了许多(> 15)页面/视图/框架,那么以下内容可能会有用。

你需要有一看:

1. numberOfViewsInSession:定义(顶级)视图状态(页)的数量,以支持后退按钮操作

2. numberOfLogicalViews:定义号码逻辑视图(框架)可以出现在页面中(每个顶层视图)

快速确定它是否相关的操作是将这些数字设置为500,并参阅 如果它们是相关的,您可以在以下链接中找到更多信息:

http://www.java.net/node/681211

Problem with numberOfViewsInSession and multiple tabs

+0

但这将不起作用时: 1)会话已过期 2)应用程序已实时 – 2013-04-03 11:36:57