Session 使用多个spring MVC portlet的Liferay上的会话超时

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

我们的应用程序是在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

有什么建议吗

如果您只是在Portlet中进行Ajax导航,那么您可能希望以必须查找的方式连接到Liferay的会话扩展-客户端计时器会倒计时并显示session.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

这是发生在你所有的页面上还是只发生在特定的页面上? 点击任何按钮都会发生这种情况吗

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

function onClickFunction(){
 var liferaySession = Liferay.Session._currentTime;
 if(liferaySession == '0'){
   //reload page
  }
 else{
   //proceed
  }
}

尝试在删除登录portlet的portal-ext.properties中添加auth.login.url=/web/guest/home。