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 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
|
//redirect must happens before removeDesktop below, otherwise you get NPE
|
||||||
Executions.getCurrent().sendRedirect("index.zul");
|
Executions.getCurrent().sendRedirect("index.zul");
|
||||||
|
|
||||||
//remove old desktop
|
//remove old desktop
|
||||||
if (desktopCache != null)
|
if (desktopCache != null) {
|
||||||
|
desktop.setAttribute(DESKTOP_SESSION_INVALIDATED_ATTR, Boolean.TRUE);
|
||||||
desktopCache.removeDesktop(desktop);
|
desktopCache.removeDesktop(desktop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -237,6 +237,11 @@ public class SessionContextListener implements ExecutionInit,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object sessionInvalidated = desktop.getAttribute(AdempiereWebUI.DESKTOP_SESSION_INVALIDATED_ATTR);
|
||||||
|
if (sessionInvalidated != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
|
if (ServerContext.getCurrentInstance().isEmpty() || !isContextValid())
|
||||||
{
|
{
|
||||||
setupExecutionContextFromSession(Executions.getCurrent());
|
setupExecutionContextFromSession(Executions.getCurrent());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue