I’m facing a strange problem that I couldn’t figure out using Vaadin 6.7.5.
My application has a HomePage that is loaded when it starts. This page has a login button that calls a login subwindow.
After a successful login I remove the login subwindow and set the AuthPage as the content of main window.
The AuthPage has a logout button which has a listener that calls application.close() method and redirects to the homepage again.
The problem that I’m facing is that after I have successfully logout, I can’t login again because clicking in the login button doesn’t show me the login subwindow anymore.
Could someone give some tip to help me discover what I’m doing wrong ?
Is anything displayed on the command line or in the logs ?
Can you run in debug mode and put a breakpoint in the button click listener to know what happens ?
Is your subwindow recreated everytime or is it a static/reused instance ?
The problem that I was facing was related to ThreadLocal as I was suspecting. I’ve used the feature of eclipse to create get and set methods for currentApplication attribute, and I’ve messed with setInstance method:
public void onRequestEnd(HttpServletRequest request,
HttpServletResponse response) {
// Clean up thread-local app
setInstance(null);
}
private static void setInstance(TaskManagerApp application) {
if (currentApplication.get() == null) {
currentApplication.set(application);
}
}
So, after I’ve change this method, everything comeback to work properly: