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
[Message sent by forum member 'writtmeyer' (writtmeyer)]
http://forums.java.net/jive/thread.jspa?messageID=336024