Application

I know I can reset my application writing

htttp: / / localhost / myAplication /? restart

how I can reset my application from java ??

  • Restart the servlet engine
  • Invalidate your session with someting like session.invalidate()
  • Redirect the browser to the htttp: / / localhost / myAplication /? restart url

André

Restarting the application can mean several things.

?restartApplication is not a true restart. It causes the init() method to be called again, which typically causes things to be redrawn on the screen, This is useful when developing, but I am not sure what you gain by doing this from Java. Note that in this context only the current session is affected (not the web application as a whole – the web application is the sum of all running sessions)

If you want a true restart of all the sessions, and make sure the web application reinitializes static variables, then you have to work at the J2EE container level – the web application must be told to shut down and restart. For that to happen, you can use JMX, or if using Tomcat you can use the “manager” URLs to get the application to restart. Finally, in most web servers, touching “WEB-INF/web.xml” file will cause a restart (note that this does NOT work with Tomcat under Eclipse, and that in Tomcat 7 a special configuration is required for this to work).

Call application.close()

(this is the same as giving ?restartApplication on URL)

so application.close equals url link http//miserver/myApplication?restart

application.close not delete session is correct???
how to delete the session using java vaadin??

Close() removes the application state from the HttpSession.

If you need to invalidate the whole session, you should be doing something like:
((WebApplicationContext) myApplication.getContext()).getHttpSession().invalidate()