JSP:获取查看者的IP

发布于 2024-10-07 21:16:31 字数 255 浏览 0 评论 0原文

您好,

我正在使用 Apache Tomcat 6.0,并使用 Windows 7 Professional 作为操作系统。 我使用 Netbeans 6.9.1 开发了一个 JavaEE 项目 我在 Dyndns 上有一个直接连接到 Apache Tomcat 6.0 的域。

我想知道这是否可能? 我想跟踪/监控当前正在查看我的域的 IP (IPv4 / IPv6)。 另外,我还可以监控他们正在查看我的项目的哪些部分吗?

谢谢, 西里尔·H.

Greetings,

I am using Apache Tomcat 6.0 using Windows 7 Professional as my OS.
I have developed a JavaEE project using Netbeans 6.9.1
I have a domain on Dyndns that goes directly to the Apache Tomcat 6.0.

I was wondering if this is possible?
I want to track/monitor the IP (IPv4 / IPv6) which are currently viewing my domain.
Also, can I also monitor what part of my project are they viewing.

Thanks,
Cyril H.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空气里的味道 2024-10-14 21:16:31

要查看当前查询字符串,您可以使用:

((HttpServletRequest)request).getQueryString();
((HttpServletRequest)request).getRequestURL();

从那里您可以提取项目的当前部分。

获取远程 IP/主机:

request.getRemoteAddr();
request.getRemoteHost();

您可以在 jsps、servlet 或过滤器中使用两者。

To view the the current query string you can use:

((HttpServletRequest)request).getQueryString();
((HttpServletRequest)request).getRequestURL();

from there you could extract the current part of your project.

To get the remote IP/host:

request.getRemoteAddr();
request.getRemoteHost();

You can use both in your jsps, servlets or filters.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文