English 中文(简体)
Java webapp: how to implementing a web bug (1x1 pixel)?
原标题:Java webapp: how to implement a web bug (1x1 pixel)?

在以下问题的公认答复中,一个有13K+ rep的普通SO公司建议使用“网吧”(不可调用1x1 兆克),以跟踪记录中的要求:

...... 页: 1

我如何在 Java这样做?

基本上,我谈两个问题:

  • 如何确保1x1图像不可行(如何打上头盔)?

  • 如何确保这些1x1图像的询问在记录中出现?

I m 寻找准确的编码,因为我知道如何写出一页的书,我知道如何为1x1图像服务:

我的问题是,我应该写出的那段话题,以及需要怎样做/做什么才能使托马托克提出这一要求。

例如,我计划使用以下地图:

<servlet-mapping>
        <servlet-name>WebBugServlet</servlet-name>
        <url-pattern>/webbug*</url-pattern>
</servlet-mapping>

然后使用img tag referencing a webbug.png>(或.gif),因此我如何写上jsp/servlet?

在标识中,我应怎么看待?

最佳回答

简单的方法是增加联合企业形象的日期。 这将使图像无法跟上。

<%
java.util.Date dt = new java.util.Date ();
%>
<img src="/invisible.jpg?<%=dt.getTime ()%>" width="1" height="1">

在您的出入记录中,你可以计算出你的分机——产出应为

127.0.0.1 - - [10/Jun/2010:11:38:53 +0530] "GET /mywebapp/jsp/invisible.jpg?1276150133362 HTTP/1.1" 200 991
127.0.0.1 - - [10/Jun/2010:11:38:54 +0530] "GET /mywebapp/jsp/invisible.jpg?1276150134659 HTTP/1.1" 200 991
127.0.0.1 - - [10/Jun/2010:11:38:55 +0530] "GET /mywebapp/jsp/invisible.jpg?1276150135627 HTTP/1.1" 200 991

在这一方法中,你赢得了需要“保护”地图。

另一种做法将涉及撰写一个列席班,以建立切身控制头。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签