cancel
Showing results for 
Search instead for 
Did you mean: 

How should I found the current URL from a webdynpro application?

Former Member
0 Kudos

Hello All,

How should I found the current URL from a webdynpro application?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yoel

You can follow this code :

//get deployable object name that the component belongs to

String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
try{
		WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart(deployableObjectName,"WDApp",WDDeployableObjectPartType.APPLICATION);
		String urlToWDApp = WDURLGenerator.getApplicationURL(deployableObjectPart);
		
}catch(Exception ex){
    	wdComponentAPI.getMessageManager().reportException(ex.getMessage(),false);
    }

I hope this helps you.

Regards

Kapil

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Hi

You can do it by finding IPaddress and port number of you application..

getWebContextAdapter().getHttpServletRequest.getServer...

String hostName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName();

int port = TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort();

now you have to form url as

http://hostName/+port as a string

this will solve your problem

regards

ravi

Former Member
0 Kudos

This may work for the moment, but as it uses internal non-API classes, it might stop working after upgrading.

Armin

Former Member
0 Kudos
Former Member
0 Kudos

Hi

could you please elaborate your question.

regards

ambicasony