You mean at "Windows" startup? Since you posted this in the servlets forum I'm assuming you want this code to run in a servlet container for some reason. The only way to do that would be to put the code in a servlet context listener of your web app, and set up the servlet container to run at startup time. Tomcat can be installed as a Windows service, and a Windows service can be set to run at startup, so that should do the trick.
Hi The question is not clear what you want exactly window start up means web application or stand alone application if its web use onLoad() java script function.
Joined: Mar 22, 2005
prasad guna wrote:if its web use onLoad() java script function.
That is very unlikely to be the solution - it not only assumes that a servlet container will start, but also that a web browser will start and load a particular page after the servlet container has started. Executing code at servlet container startup time is what servlet context listeners are for.