diff --git a/modules/web/src/com/haulmont/cuba/web/DefaultApp.java b/modules/web/src/com/haulmont/cuba/web/DefaultApp.java index a417afd2e1..008a515531 100644 --- a/modules/web/src/com/haulmont/cuba/web/DefaultApp.java +++ b/modules/web/src/com/haulmont/cuba/web/DefaultApp.java @@ -27,10 +27,7 @@ import com.haulmont.cuba.security.global.LoginException; import com.haulmont.cuba.security.global.UserSession; import com.haulmont.cuba.web.app.loginwindow.AppLoginWindow; import com.haulmont.cuba.web.auth.ExternallyAuthenticatedConnection; -import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinSession; -import com.vaadin.server.WrappedHttpSession; -import com.vaadin.server.WrappedSession; +import com.vaadin.server.*; import com.vaadin.ui.UI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,6 +37,7 @@ import org.springframework.stereotype.Component; import javax.inject.Inject; import javax.servlet.http.HttpSession; +import java.io.IOException; import java.util.Locale; /** @@ -134,6 +132,14 @@ public class DefaultApp extends App implements ConnectionListener, UserSubstitut if (currentUi != null) { currentUi.setContent(null); currentUi.getPage().setLocation(loggedOutUrl); + } else { + VaadinResponse response = VaadinService.getCurrentResponse(); + try { + ((VaadinServletResponse) response).getHttpServletResponse(). + sendRedirect(loggedOutUrl); + } catch (IOException e) { + log.error("Error on send redirect to client", e); + } } VaadinSession vaadinSession = VaadinSession.getCurrent();