rizalvi
12 years agoMentor
Get IP Address Freemarker
Is it possible to obtain the IP address of someone on a page, user or otherwise? I know that I can use rest api to obtain previous ip login of a user. But I'm wondering If I use Freemarker to do this, or another solution.
Hi rizalvi,
The http.request context object (http://lithosphere.lithium.com/t5/developers-knowledge-base/http-request-FreeMarker-context-object/ta-p/9323) has a remoteAddr method which will provide the IP address associated with the request. This method is not currently documented on that page, so I'm working with our internal teams to get the documentation updated on the Lithosphere.
Here's a simple example of how to use it:
${http.request.remoteAddr}
I hope this helps!