如何在struts2动作方法中获取客户端IP地址?(How to get the client IP address inside struts2 action method?)

编程入门 行业动态 更新时间:2024-10-28 06:33:57
如何在struts2动作方法中获取客户端IP地址?(How to get the client IP address inside struts2 action method?)

有没有办法在struts2动作方法中获取客户端的IP地址?

我已经实现了SesionAware和RequestAware接口,但这两个接口只注入会话和请求映射。

Is there a way to get the client's IP address inside an struts2 action method?

I have implemented both SesionAware and RequestAware interfaces, but these two inject only the session and request maps.

最满意答案

你试过ServletRequestAware吗?

Have you tried ServletRequestAware?

更多推荐

本文发布于:2023-07-29 20:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1319463.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   动作   地址   方法   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!