ITeye博客

request.getRemoteAddr = 0:0:0:0:0:0:0:1

harbey · 2010-05-24 14:35 · 企业架构 · Markdown

做IP地址过滤时,非代理获取客户端ip时,用http://localhost:8080/aapname访问应用程序,通过如下代码获取客户端ip为0:0:0:0:0:0:0:1:

ServletActionContext.getRequest().getRemoteAddr();  

原因是跟操作系统有关系,我用的是windows7操作系统,支持IP V6格式,所以输出0:0:0:0:0:0:0:1;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。