cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch server port number.

Former Member
0 Kudos

Hi All,

I want to disaply host name & port number of present server in the textview.

For Host name i have used following code. It's working great.

InetAddress n=InetAddress.getLocalHost();

String name=n.getHostName();

wdContext.currentContextElement().setSn(name);

In the same way i need The Server port number also. Can you give whcih calss i have to use to get port number. plase give me the solution.

Thanks and Regards

Praveen.D

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Using WDURLGenerator.getAbsoluteWebResourceURL(deployableObjectPart); you will get the complete url then you need to have a logic to just take Hostname : hostport

Vinay