【发布时间】:2012-09-07 05:02:11
【问题描述】:
我有一个播放框架应用程序,用户在其中输入表单提交,routes 已设置为通过index.scala.html 文件显示帖子。
如何获取用户的 IP 地址?我想用他的位置标记那个帖子。
【问题讨论】:
标签: java playframework location playframework-2.0 ip-address
我有一个播放框架应用程序,用户在其中输入表单提交,routes 已设置为通过index.scala.html 文件显示帖子。
如何获取用户的 IP 地址?我想用他的位置标记那个帖子。
【问题讨论】:
标签: java playframework location playframework-2.0 ip-address
在控制器中:
request.remoteAddress;
在控制器之外:
Http.Request.current.get().remoteAddress;
【讨论】: