on 05-16-2006 11:21 PM
Hi All,
I need to get Server Host name & port number. I got the method for getting host name. But I am not get the method for port number. can give the code for that. please do the needful...
thanks nad regards
Praveen.D
Hello Praveen ,
you can use WDURLGenerator.getAbsoluteWebResourceURL(deployableObjectPart)
This will give you the whole url of the application in a string format.
then u need to have a simple logic to get the substring of the url to get only the hostname:hostport.
Vinay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I think you can get the server name and server port number directly by using following the following:
WDSystemLandscape.getSLDHost()
and WDSystemLandscape.getSLDPort()
I hope it helps
Thanks and regards
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this (although it uses a deprecated API):
WDDeployableObjectPart d = wdComponentAPI.getDeployableObjectPart();
try{
String url = wdComponentAPI.getURLService().getGeneralService().getAbsoluteWebResourceURL(d);
}
catch(WDURLException e){
}
The url will be of the form http://<servername>:<serverport>/.
You can then do a bit of string indexing to find out the port number as well as the server hostname.
Regards,
Satyajit.
Message was edited by: Satyajit Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.