cancel
Showing results for 
Search instead for 
Did you mean: 

Complete URL of an iView Component !!

Former Member
0 Kudos

Environment : EP 6.0 Sp2

Following is the complete url of an iview ...

http://<servername>:<port>/irj/servlet/prt/portal/prtroot/<componentName>.default

I am using the following code to get the url ...

IPortalUrlGenerator portalGen = null;

IUrlGeneratorService urlGen = (IUrlGeneratorService)componentRequest.getService(IUrlGeneratorService.KEY);

ISpecializedUrlGenerator specUrlGen2 = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);

if (specUrlGen2 instanceof IPortalUrlGenerator)

{

portalGen = (IPortalUrlGenerator) specUrlGen2;

}

String strUrl = new String();

if (portalGen != null)

{

strUrl = portalGen.generatePortalComponentUrl(componentRequest, "ComponentName.default");

}

with the above code, the url I am getting ( in strUrl vaiable) is ...

"/irj/servlet/prt/portal/prtroot/<componentName>.default"

How can I get the url part "<servername>:<port>" so that I append it to the above string to get the complete url of the portal component or is there any other way to get a complete URL of a component ??

I appreciate your help !!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Will.

It is working now !!

Former Member
0 Kudos

Use the HttpServletRequest object to get the bits you need:

String strUrl = "/blah/blah";

HttpServletRequest srq = componentRequest.getServletRequest();

String url = srq.getScheme()+"://" +

srq.getServerName() + ":" +

srq.getServerPort() ;

response.write (url + strUrl);