Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2004 at 09:21 PM

    Thanks Will.

    It is working now !!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.