Skip to Content
avatar image
Former Member

Complete URL of an iView Component !!

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 !!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 20, 2004 at 08:53 PM

    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);

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 20, 2004 at 09:21 PM

    Thanks Will.

    It is working now !!

    Add comment
    10|10000 characters needed characters exceeded