Re: How to get port of a running Tomcat instance

2007-08-23 Thread Vamsavardhana Reddy
I do not know if this info is helpful... ServletRequest has getServerPort() and getServerName() methods that should give the port and server through which the request came. Vamsi On 8/24/07, Brian Barnett [EMAIL PROTECTED] wrote: Can someone provide a java code snippet showing how to get the

Re: How to get port of a running Tomcat instance

2007-08-23 Thread David Delbecq
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getLocalPort() You can only get the port from a request. This is because a sepecific webapp can be served from serveral hostname and from several port, all sharing same instance of servlet. (basic example is tomcat with

RE: How to get port of a running Tomcat instance

2007-08-23 Thread Brian Barnett
Yes of course, that makes sense. I will use Vamsi's suggestion with ServletRequest.getServerPort(). Thank you. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Thursday, August 23, 2007 2:03 PM To: Tomcat Users List Subject: Re: How to get port of a running Tomcat