Eclipce WDT 中的 Servlet 文件上下文
我的任务是构建一个网络嗅探器,将捕获的 IP 转换为其地理位置。 我使用 MaxMind GeoIP API 及其数据库 (GeoIP.dat) 来执行此操作,并且它工作得很好(作为一个简单的 java 应用程序)。
现在,我的目标是按照以下方式将其用作网络服务器上的工具。 专用网站(实际上只有一个页面)将使结果(流量位置的分布)在远程浏览器上可见。
更清楚地说,嗅探器将捕获某些计算机网卡上的流量,并且网站(位于该计算机上)将提供一种从远处查看结果的方法。
我想使用服务器端 servlet 来实现它,该 servlet 将使用从嗅探器获得的结果刷新客户端页面。
问题是我在网站开发方面的经验为零,在 servlet 方法方面的知识也为零 - 我正在即时学习,阅读大量信息。
更具体地说,目前我不知道将该 GeoIP.dat 文件放置在哪里,以便可以从 servlet 的上下文中访问它。
我正在使用带有 WDT 和 Apache Tomcat 6 的 Eclipse IDE。 无论我将文件放置在动态 Web 项目树中的哪个位置,都找不到该文件并且会出现异常。 它应该在项目树中吗? Eclipse在开发过程中将调试后的网站发布到哪里?
我希望我说得足够清楚。如果我不是,请告诉我,我会尽力更准确。 如果有人能指导我一点,我将非常感激。
My task is to build a network sniffer that translates the captured IPs to their GeoLocations.
I used the MaxMind GeoIP API and their database (GeoIP.dat) to do so and it work just fine (as a simple java application).
Now, my goal is to use this as a tool on a web server the following way.
A dedicated web site (actually with a single page) will make the results (the distribution of the traffic locations) visible on a remote browser.
To be more clear, the sniffer will capture the traffic on some machine's network card and a website (that is located on that machine) will provide a way to view the results from far away.
I thought to implement it using a server side servlet that will refresh the client side page with the results it will get from the sniffer.
The problem is that i have zero experience in web sites development and zero knowledge in the servlets methodology - I am learning on the fly, reading a lot of info.
To be more specific at this moment, I don't know where to place this GeoIP.dat file so it will be accessible from the servlet's context.
I'm using the Eclipse IDE with WDT and Apache Tomcat 6.
No matter where i place the file in the dynamic web project tree, the file isn't found and an exeption arises.
Is it supposed to be in the project tree at all?
To where does Eclipse publish the debugged web site during development?
I hope i was clear enough. If i wasn't please tell me and i'll try to be more accurate.
I'll be very grateful if anyone could direct me a bit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论