Activity Forums Salesforce® Discussions How to display the browser Current URL in Visualforce Page

  • Laveena

    Member
    October 11, 2019 at 1:02 pm

    Hi Deepak,

    If your page is using a controller or extension (if it's not, just create an extension) then you should be able to get the URL you're after using the referer header for the Visualforce page.

    Use the following method to get the URL:

    public String getReferer()
    {
    return ApexPages.currentPage().getHeaders().get('referer');
    }
    Then you can just get this in your page using:

    <apex:outputText value="{!Referer}"/>

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos