0

我们的应用程序是在 Liferay 上开发的,页面上有多个 Spring MVC portlet。它是一个单页应用程序,并且导航只发生在 portlet 内部。现在有时当 Liferay 会话超时并且我向控件发送一个新视图的请求时,liferay 登录页面将显示在 portlet 中。但是预期的行为是如果 liferay 会话超时,那么整个页面应该已经重定向到登录页面。我在 portal-ext.properties 中指定了以下属性

session.timeout.warning=1
session.timeout.auto.extend=false
session.timeout.redirect.on.expire=true
browser.cache.signed.in.disabled=true

有什么建议么?

4

2 回答 2

0

如果您只是在 portlet 中进行 Ajax 导航,您可能想要连接到 Liferay 的会话扩展方式(您必须查找它 - 有一个客户端计时器倒计时并显示“session.timeout.warning “ - 我现在不能指点)

或者,如果只要浏览器窗口打开,会话扩展就可以接受,您可以使用相同的机制来显示替代行为:它可以扩展会话,而不是自愿超时。请参阅门户(-ext).properties:

#
# Set the auto-extend mode to true to avoid having to ask the user whether
# to extend the session or not. Instead it will be automatically extended.
# The purpose of this mode is to keep the session open as long as the user
# browser is open and with a portal page loaded. It is recommended to use
# this setting along with a smaller "session.timeout", such as 5 minutes for
# better performance.
#
session.timeout.auto.extend=true
于 2013-12-14T17:33:57.637 回答
0

这发生在您的所有页面还是仅在特定页面上。? 单击任何按钮时会发生这种情况吗?

如果是这样,请在单击按钮时调用的方法中执行以下操作,

function onClickFunction(){
 var liferaySession = Liferay.Session._currentTime;
 if(liferaySession == '0'){
   //reload page
  }
 else{
   //proceed
  }
}
于 2014-01-24T07:16:57.457 回答