You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by webzo <we...@yahoo.com> on 2007/05/08 22:30:52 UTC

How to programatically determine connector's port numbers?

Hello all,
Is there a way to programmatically determine (using Java) the port numbers that have been set up (in server.xml) for use by the SSL and Non/SSL connectors? By default they are 8080 and 8443 but I need to be able to determine it programmatically as well. 

Thanks.

Av.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to programatically determine connector's port numbers?

Posted by Hassan Schroeder <ha...@gmail.com>.
On 5/8/07, webzo <we...@yahoo.com> wrote:

> Is there a way to programmatically determine (using Java) the port numbers that have been set up (in server.xml) for use by the SSL and Non/SSL connectors?

You can get them from the ServletRequest object, a more portable
approach than extracting them from a container-specific config file.

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to programatically determine connector's port numbers?

Posted by Martin Gainty <mg...@hotmail.com>.
Looks like you'll have to use an embedded container e.g.
http://fisheye5.cenqua.com/browse/glassfish/appserv-core/src/java/com/sun/enterprise/web/WebContainer.java?r1=1.74&r2=1.75
int[] ports= _embedded.getEngines().vsArray[0].getPorts()

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "webzo" <we...@yahoo.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, May 08, 2007 4:30 PM
Subject: How to programatically determine connector's port numbers?


> Hello all,
> Is there a way to programmatically determine (using Java) the port numbers 
> that have been set up (in server.xml) for use by the SSL and Non/SSL 
> connectors? By default they are 8080 and 8443 but I need to be able to 
> determine it programmatically as well.
>
> Thanks.
>
> Av.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org