Hot deploy to Tomcat in Eclipse?

Hi
am struggling with this.
Working with simplest Vaadin webapp

package webapp;
import com.vaadin.ui.*;
public class HelloWorld extends com.vaadin.Application {
public void init() {
Window main = new Window(“Hello window”);
setMainWindow(main);
main.addComponent(new Label(“Hello world!”));
}
}

To run the app on server works fine, but here’s what happens when I edit and save label as “Hello cosmos”
Although I see the class being updated under the org.eclipse.wst.core.server.. …\wtpwebapps folder, when I refresh the browser it still shows Hello world

I have to stop/start server to see changes

Is there a better way?
Thanks
\Dave Mc

You can use a URL parameter “?restartApplication” to clear the session/app. After that you’ll get a fresh modified version.

Thanks Jouni
that has saved me a lot of clicking
\DaveMc

Could you please explain me why this is happening and why I have to do that :slight_smile: Another way is to clean everything but it’s too slow way to handle this. So what’s happening under the bonnet? Js is not updating without ?restartApplication…

Everything is updated and deployed just fine, the reason why you are seeing the old version is that the servlet container (e.g. Tomcat) serializes the state of the application (stored in the session) when stopping and then restores the state when starting. This means that the earlier session still exists after a restart/redeploy and when refreshing the browser it will happily tell the server that it already has a session and the server will use that session. Therefore init() etc. are never be called as a new application instance is not created (no need, there is already an instance), instead the current (old) state will be sent to the client and rendered, right as it was before restart/redeploy.