I have a java web application, which runs on a number of servers. Some of the servlets in this application load on startup to preload some data. The protocal for loading this data will change based on what server the application is deployed on. (The path of the files to be loaded change, also there are difference in security so getting some files is more involved then others). Is there a way that I can uniquely identify the server/machine that my application is on in the init function of a java servlet? I orginally was working with HttpServletRequest.getServerName(),
which was enough, but it is not available in the init. I know about lazy initialization, so don't tell me to do that, I am trying to avoid that if possible since the load times on these file are significant. If I could find the machine name that would be perfect but i can't figure out how to get this out of the api's. All I need is a way to uniquely identify machines from the init.
Thanks for any help.