Sessions (i think so)

Hello.
I’m a new at vaadin and I have some (mb stupid) questions.

  1. After i made change in my code i need to clean browser cache for to see changes. Why oO?
  2. This code working only once when starting new session, after refresh notification doesn’t work. What I’m doing wrong?

		testWindow = new Window();
		setMainWindow(testWindow);
		
		WebApplicationContext context = (WebApplicationContext) getContext();
		HttpSession session = context.getHttpSession();
		testWindow.showNotification(session.getId());

Bonjour,

  1. yes, in some situations and depending on which web browser I use, I haver to clear the cache. Typically when I change a ressource (image, css, …). But each time I change the code, I see the change at the next session. I do not suspect vaadin but your jee server. When you deploy the new application (war file), do you restart the server ?

  2. when you click on refresh, the current session is kept. Your notification has been displayed once, the code is not run again and your notification is of type “humanized”. The notification window is closed after a few seconds or when you clicked on refresh.

have a nice day.

For testing, use the additional parameter “?restartApplication” to close the application and restart it when you reload the page. You might also want to turn off session serialization over server restarts in your test server if it is on - e.g. on Tomcat it is the parameter “Manager” in context.xml of the server (see the comments in that file).

As for the browser cache, in addition to the server, the browser can be the culprit - e.g. Google Chrome caches some CSS aggressively even though the server tells the browser not to cache it. Doing several forced refreshes (Ctrl+F5) might or might not help.