Skip to Content

fetching the URL from portal component

hi experts,

i have a requirement like , my portal can be accessed by two URLs one is public URL and another one is local intranet URL , is there any way to identify the URLs , through which end user is accessing the portal



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 05, 2014 at 01:20 PM


    I don't think that the AliasService would be sufficient due to the fact that this service delivers only the URL after the host name (e.g. /irj/portal) and these could be equal in this scenario.

    From my point of view you should use request.getServletRequest().getRequestURL() to check via which hostname (external URL / internal URL) the portal was called.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 05, 2014 at 04:00 PM

    You can read the alias with the following code:

    IAliasService aliasService =

    (IAliasService) PortalRuntime.getRuntimeResources().getService(IAliasService.KEY);

    IAliasHelper l_aliasHelper = (IAliasHelper) aliasService;

    String url = l_aliasHelper.getPath(request);

    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.