tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: Tomcat 4: howto get (connector's) port in Servlet.init()
Date Tue, 15 Jul 2003 13:33:53 GMT
No. A servlet can be served by any port that the server is configured to.

For example, in a dev environment - I run apache on 80 and the standalone 
connectors on 8080. So in the dame tomcat instance, I can issue one request 
to port 80, then another to 8080 for the same servlet.

You can only (reliably) get the port used within the scope of that particualr 
request. Look at the HttpServletRequest object.


Hans Schlenker wrote:
> Hi!
> Is there a way (apart from scanning the log files or reading config 
> files) to get the port of the Connector of a Servlet from within 
> Servlet.init()?
> Hans Schlenker

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message