• SFDCDEV49
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Can any one help me on this error?.. I am trying to get the Ip address of system through a custom link.. Here is my code. ANy help will be appreciated. Thanks

 

Controller:

public

withsharingclassIpaddress {

 

public string ipaddress{get;set;}

 

publicIpaddress(ApexPages.StandardController controller) {

 

//String Ipaddress= ApexPages.currentPage().getHeaders().get('X-Salesforce-SIP');

 

}

 

 

publicstring ipvalue(){

Ipaddress= ApexPages.currentPage().getHeaders().get(

'X-Salesforce-SIP');

 

//ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'your address '+Ipaddress));returnIpaddress;

 

 

}

 

}

 

Page:

<

apex:pagestandardcontroller="Account"extensions="Ipaddress"><!-- Begin Default Content REMOVE THIS -->

<

apex:form><apex:pageblockid="test"><apex:commandLink action="{!ipvalue}"rerender="test"> ipaddress </apex:commandLink></apex:pageblock></apex:form></apex:page>