How to get the IP address of an incoming request in Java Play 1.2.4

I see on Play! 2.0 is Http.Context.current () http://www.playframework.org/documentation/api/2.0/java/play/mvc/Http.Context.html#current ()

But in the game! 1.2.4 How can I get the current IP address of an HTTP request?

Thanks.

+8
playframework
source share
1 answer

If you are inside the controller, you can do

request.remoteAddress; 

Otherwise you will need to do

 Http.Request.current.get().remoteAddress; 
+18
source share

All Articles