cancel
Showing results for 
Search instead for 
Did you mean: 

Get URL of portal

Former Member
0 Kudos

Hello!

I have, seems like, simple question:

How to get url of portal ( http://mydomain:port /irj/portal/....), which see user?

(For example, portal server access by ip 10.18.0.1, but user in file 'hosts' have alias mydomain for this ip, accordingly have http://mydomain:port /irj/portal/... in address bar)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Paul,

Actually thing is that we can not access portal with its IP address so we save its Ip address with host name in drivers and then access it with its host name

For eg if ur portal Ip Address is 10.18.0.1 and u have saved it with its Host name as hello and ur instance number of ur server is 01 then ur port numbre will be

Port Number = 50000+100*Instance number

Ie Port number will be 50100

and host name willll be hello

so whole URL to access ur portal will be

http://hello:50100/irj/porttal

Hope this will help u

regards.

Soni Vinit

Former Member
0 Kudos

Thanks, Vinit Soni!

But it's my fault, that I didn't convey question more concrete.

I mean, how to get this URL in java code of portal page?

Former Member
0 Kudos

Hello,

Kindly open Portal Log on Page Par file in NWDS to find the required input's

Regards.

Soni Vinit

Former Member
0 Kudos

Sorry, but I don't understand what do you mean

Former Member
0 Kudos

I found it! Problem solved.

IPortalComponentRequest componentRequest = (IPortalComponentRequest)getRequest();
componentRequest.getServletRequest().getServerName();
componentRequest.getServletRequest().getServerPort();

detlev_beutner
Active Contributor
0 Kudos

Hi Paul,

Please keep in mind that there is a long-running-war in opinion which server / port is reported by these methods when there is a proxy set in front of the portal. From my understanding (and I think this is backed up by the corresponding RFCs), the method should always return the server name/port how the original client uses it. Nevertheless, for example Apache and Tomcat both have the possibility to switch this to the proxies address. And Novell iChain for example does a dumb mix (name of the original client, port of the proxy, or vice versa, don't remember exactly).

So use it with care... That's also the reason why for example SAP doesn't trust this method (and many software doesn't) and let's the admin fill in the end-users server name / port as a config.

Hope it helps not to trap into a pit,

best regards

Detlev

Answers (0)