Howdy, Then you'll have to update the configuration files every time you move your server. You should be able to automatically do this with Ant every time you redeploy your server.
Your alternatives become more and more complicated: - implement a registry (this can just be another server with a known host and port that has one page listing the location of your server), have the server deployment update the registry, have the clients lookup the server location via the registry. Or - Have the clients and the server implement some sort of discovery mechanism and the clients scan your network until they find the server etc. No need to get complicated solutions to a simple problem. Changing the server host and port will usually require changing a configuration on the clients connecting to the server. It's that simple... Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: rf [mailto:[EMAIL PROTECTED] >Sent: Thursday, March 06, 2003 1:37 AM >To: Tomcat Users List >Subject: RE: Hostname/port from ServletContext > >I have been doing exactly the same. But whenever I run >my server on a different port I have to update the >configuration file. (yeah, the information in the my >case is the local hostname and port). That is why I >wanted to pick these information at application >startup time. > >--- "Shapira, Yoav" <[EMAIL PROTECTED]> wrote: >> >> Howdy, >> Put the information in a configuration file your >> clients read when they >> start up. >> >> Yoav Shapira >> Millennium ChemInformatics >> >> >> >-----Original Message----- >> >From: rf [mailto:[EMAIL PROTECTED] >> >Sent: Wednesday, March 05, 2003 12:06 PM >> >To: Tomcat Users List >> >Subject: Re: Hostname/port from ServletContext >> > >> > >> >--- Tim Funk <[EMAIL PROTECTED]> wrote: >> >> You can't. That is because the context runs in >> some >> >> type of service >> >> which will present you with the requests. So only >> at >> >> request time can >> >> you know the hostname and port number of the >> server. >> >> >> > >> >Thanks for the info. I understand - the context is >> at >> >a lower layer. Let me explain my problem, may be >> you >> >can suggest me a soln. >> > >> >I have some funcionality available on my server >> that >> >is supposed to be used by clients over >> network(http). >> >Now to demonstrate this I have some sample clients >> >within my server, how are these supposed to connect >> to >> >the server? I need the hostname & port to construct >> >the server URL at beginnning of my web application, >> >and make it available to the sample clients to use. >> > >> >How is this kind of a problem typically approached? >> > >> >Thanks >> >rf >> > >> >__________________________________________________ >> >Do you Yahoo!? >> >Yahoo! Tax Center - forms, calculators, tips, more >> >http://taxes.yahoo.com/ >> > >> >>--------------------------------------------------------------------- >> >To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> >For additional commands, e-mail: >> [EMAIL PROTECTED] >> >> >> >> >> This e-mail, including any attachments, is a >> confidential business communication, and may contain >> information that is confidential, proprietary and/or >> privileged. This e-mail is intended only for the >> individual(s) to whom it is addressed, and may not >> be saved, copied, printed, disclosed or used by >> anyone else. If you are not the(an) intended >> recipient, please immediately delete this e-mail >> from your computer system and notify the sender. >> Thank you. >> >> >> >--------------------------------------------------------------------- >> To unsubscribe, e-mail: >> [EMAIL PROTECTED] >> For additional commands, e-mail: >> [EMAIL PROTECTED] >> > > >__________________________________________________ >Do you Yahoo!? >Yahoo! Tax Center - forms, calculators, tips, more >http://taxes.yahoo.com/ > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
