IDEMPIERE-4206 Session timeout shown sometimes when changing roles
This commit is contained in:
parent
6e606799f9
commit
bf8f5ea8c1
|
@ -81,6 +81,8 @@ import org.zkoss.zul.Window;
|
|||
*/
|
||||
public class AdempiereWebUI extends Window implements EventListener<Event>, IWebClient
|
||||
{
|
||||
public static final String DESKTOP_SESSION_INVALIDATED_ATTR = "DesktopSessionInvalidated";
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -569,9 +571,11 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
|||
//redirect must happens before removeDesktop below, otherwise you get NPE
|
||||
Executions.getCurrent().sendRedirect("index.zul");
|
||||
|
||||
//remove old desktop
|
||||
if (desktopCache != null)
|
||||
//remove old desktop
|
||||
if (desktopCache != null) {
|
||||
desktop.setAttribute(DESKTOP_SESSION_INVALIDATED_ATTR, Boolean.TRUE);
|
||||
desktopCache.removeDesktop(desktop);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -237,6 +237,11 @@ public class SessionContextListener implements ExecutionInit,
|
|||
return;
|
||||
}
|
||||
|
||||
Object sessionInvalidated = desktop.getAttribute(AdempiereWebUI.DESKTOP_SESSION_INVALIDATED_ATTR);
|
||||
if (sessionInvalidated != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
|
||||
{
|
||||
setupExecutionContextFromSession(Executions.getCurrent());
|
||||
|
|
Loading…
Reference in New Issue