读书人

spring webservice ws 怎么获得 客户端

发布时间: 2012-09-22 21:54:54 作者: rapoo

spring webservice ws 如何获得 客户端 client ip

最近有朋友问我 如何在spring ws 里面的服务器端得到 客户端ip

?

google 了一下 ,还真没有

?

最终显然是应该如何获取 request

?

看了一下代码,只需要强转一下 即可。

?

?WebServiceConnection serviceConnection =

TransportContextHolder.getTransportContext().getConnection();

?

??????? HttpServletConnection httpServletConnection = (HttpServletConnection) serviceConnection;


??????? HttpServletRequest request = httpServletConnection.getHttpServletRequest();

?

?

读书人网 >Web前端

热点推荐