users@glassfish.java.net

Re: http-listener-1 port

From: <w.rittmeyer_at_jsptutorial.org>
Date: Tue, 10 Mar 2009 11:08:14 +0100

When you are using a web-app the port is available on the request object: request.getServerPort().

This way your code will be deployable to different listeners or domains and works even on other servers than GlassFish. Of course there is no reason for the latter ;-)


--
Wolfram Rittmeyer
>Maybe I wasn't clear enough in the initial post. Let me retry:
>I have multiple glassfish servers installed that have different 
>http-listener-1 ports configured. 
>The same web app is deployed on each server. Somewhere in my web app I return 
>a link containing a port number, which differs for each server. Should I then 
>for each server parse the domain.xml, which in turn is installed on a variable 
>location? This would require an environment variable like GLASSFISH_HOME
>I fail to believe there is no better way to do this... shouldn't the port be 
>some kind of global server property?
>[Message sent by forum member 'tibbar' (tibbar)]
>
>http://forums.java.net/jive/thread.jspa?messageID=335981
>