If you want to run something on startup you can do itvia a web.xml file:

Plus the fact that doing it more along the lines of this way makes it machine independent. You wouldn't want to change everyone's startup script if this is going to be installed on machines other than your own.