我们的应用程序是在Liferay上开发的,页面上有多个Spring MVC portlet。它是一个单页面应用程序,导航只发生在portlet中。现在,有时当Liferay会话超时并向控件发送新视图请求时,liferay登录页面将显示在portlet中。但预期的行为是如果liferay会话超时,那么整个页面应该重定向到Login页面。 我在portal-ext.properties
中指定了以下属性session.timeout.warning=1
session.timeout.auto.extend=false
session.timeout.redirect.on.expire=true
browser.cache.signed.in.disabled=true
有什么建议吗?
答案 0 :(得分:0)
如果你只是在portlet中进行Ajax导航,你可能想要挂钩Liferay的会话扩展方式(你必须查找它 - 有一个客户端计时器倒计时并显示“会话”。 timeout.warning“ - 我现在不能指点)
或者,如果只要浏览器窗口打开就可以接受会话扩展,则可以使用相同的机制来显示替代行为:它可以扩展会话,而不是自愿超时会话。请参阅portal(-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
答案 1 :(得分:0)
这是发生在您的所有网页中还是仅发生在特定网页上。 ? 点击任何按钮会发生这种情况吗?
如果是这样,请在单击按钮
时调用的方法中执行以下操作function onClickFunction(){
var liferaySession = Liferay.Session._currentTime;
if(liferaySession == '0'){
//reload page
}
else{
//proceed
}
}