cancel
Showing results for 
Search instead for 
Did you mean: 

how to capture ip address in portal for a particular app

0 Kudos

Hi I have the similar requirement to capture the IP Address of clients while running a particular application from portal. Can anyone please help me in capturing this requirement.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Santosh,

If you are trying to capture the IP Address in a java based application, below code will be helpful. Highlighted String will have the user's system IP address.

import java.net.InetAddress;

import java.net.UnknownHostException;

try {

InetAddress ipAddr = InetAddress.getLocalHost();

String IP = ipAddr.getHostAddress();

} catch (UnknownHostException ex)

{ ex.printStackTrace(); }

Regards,

Kamal