在WebWork中获取客户端IP
我使用的是:
ip = ServletActionContext.getRequest().getRemoteAddr();有时候能获取到,
有时候却获取的是“::”[2007-09-15 15:34:24] 2007-09-15 15:34:24,655 DEBUG [resin-tcp-connection-172.24.202.73:8009-11] - com.web.interceptor.WebInterceptor.intercept(64) | getRemoteAddr IP=::这是为什么啊?
我使用的是:
ip = ServletActionContext.getRequest().getRemoteAddr();有时候能获取到,
有时候却获取的是“::”[2007-09-15 15:34:24] 2007-09-15 15:34:24,655 DEBUG [resin-tcp-connection-172.24.202.73:8009-11] - com.web.interceptor.WebInterceptor.intercept(64) | getRemoteAddr IP=::这是为什么啊?
用他获得客户端 String ip = (String)ServletActionContext.getRequest().getRemoteAddr();
但你要在服务器上运行