on 07-20-2004 8:08 PM
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 !!
Thanks Will.
It is working now !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.