Vaadin Spring and user logout

Hi All.

Currently I’m playing around with vaadin-spring (1.0.0.beta3).

I got it running (by tutorial
I b - Getting started with Vaadin Spring without Spring Boot
) that the UI will be handled by Spring and I’m able to use CDI.
Next step is to migrate my views to spring.

But for now I have one question. In my application users are able to login and logout. Docu says, when a user logs out Session and UI should be closed. So my code for that is the following:

[code]
/*

  • Logout user by setting the current user to null and close session and UI
    */
    ApplicationContext.getCurrent().reset();

getUI().getPage().setLocation(“index.html”);
UI.getCurrent().close();

/*

  • Close the VaadinSession
    */
    getSession().getSession().invalidate();
    getSession().close();
    [/code]
    Note: ApplicationContext is here my own class which holds the current user and not a spring class.

When using Spring I thought that Spring takes care of the lifecycle of all maneged beans.
So my question is how do I logout user with vaadin 7.5 and the vaadin-spring addon and taking care to free all resources.

Another issue is, that when I redirect to index.html, no listener is available for that when using spring. Is there a way to redirect directly to
http://localhost:8080/myapp
instead of
http://localhost:8080/myapp/index.html
which in turn redirects to
http://localhost:8080/myapp
as well (workaround).

Thank you in advance,
Christoph