on 01-04-2009 1:10 PM
Hi All
I am using WDURLGenerator to get the URL of application. But i get the relative URL
../../test.com/test/TestApp
How can i get full URL
http://<hostname>:<portname>/webdynpro/dispatcher/test.com/test/TestApp
basically i want to know how can we get the hostname and portname where the application is deployed.
Regards
Sonal.
Hi,
You need to use the getAbsoluteWebResourceURL(deployableObjectPart) API of the WDURLGenerator for the complete path.
Kind Regards,
Nitin
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
String hostName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();
int port = TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort();
Thanks,
Ramani.P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi have already mentioned that i used WDURLGenerator API
String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
try {
WDDeployableObjectPart deployableObjectPart =
WDDeployableObject.getDeployableObjectPart( deployableObjectName, "PostApp",
WDDeployableObjectPartType.APPLICATION);
String urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart, new HashMap());
} catch (WDURLException e) {
wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
} catch (WDDeploymentException ex) {
wdComponentAPI.getMessageManager().reportException(ex.getLocalizedMessage(), false);
}
But the problem is i am unable to get the full URL including hostname and port name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this code,
String url = WDURLGenerator.getApplicationURL(deployableObjectpart,urlparameters);
Regards,
Sunaina Reddy T
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 one.
String temp = WDURLGenerator.getApplicationURL(wdComponentAPI.getApplication().getDeployableObjectPart());
Use try,catch blocks to capture the WDUrlException Exception.
regards,
Srikanth Reddy.T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[WDURLGenerator|http://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/services/sal/url/api/WDURLGenerator.html#getApplicationURL(com.sap.tc.webdynpro.services.sal.deployment.api.WDDeployableObjectPart)].getApplicationURL( WDDeployableObjectPart deployableObjectPart);
try{
String temp = WDURLGenerator.getApplicationURL(wdComponentAPI
.getApplication().getDeployableObjectPart());
}catch( WDURLException e){ }
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
try to use
String getApplicationURL(WDDeployableObjectPart deployableObjectPart, Map urlParameters)
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sonal,
check this
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress()
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName()
Thanks
Bala Duvvuri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.