I have a jersey service up and running. On server start up, i want the ip address and the port on which this service is deployed. This has to be done programmatically. Any ideas ??
Thanks.
Regards,
Check this one: How can I get a the host name (with port) that a servlet is at
Since Jersey is a Servlet implementation, it may be of help.
i want the ip address and the port on which this service is deployed
In fact the question is quite incorrect. Speaking about the IP addresses, your application may be deployed on some host with several network interfaces and therefore is available on several IPs. Which one is required for you then? Method getServerName returns the address, to which the request was made, as I remember.