It's okay to write a small probe to play, because it can only be embedded in the blog and so on, so this is just to get the user information, and I will write a powerful probe later.
The Code is as follows:
<% @ Page contentType = "text/html; charset = gb2312" %>
<% @ Page import = "java. util. *" %>
<STYLE type = text/css>
. Fontsize
{
Font-size: 9pt
}
</STYLE>
<Table width = "185" border = "1" align = "center" cellpadding = "0" cellspacing = "0" bordercolor = "# CCCCCC" class = "fontsize">
<Tr>
<Td colspan = "2"> <div align = "center"> self-developed jsp probe mini edition: </div> </td>
</Tr>
<Tr>
<Td width = "95"> http Protocol Version: </td>
<Td width = "84"> <% = request. getProtocol () %> </td>
</Tr>
<%
String Agent = request. getHeader ("User-Agent ");
StringTokenizer st = new StringTokenizer (Agent ,";");
St. nextToken ();
// Obtain the user's browser name
String userbrowser = st. nextToken ();
// Obtain the user's OS name
String useros = st. nextToken ();
Useros = useros. substring (0, useros. length ());
// Determine whether the user supports gzip compression transmission
String gzip = request. getHeader ("Accept-Encoding ");
If (gzip. indexOf ("gzip") <0)
{
Gzip = "not supported ";
}
Else
{
Gzip = "supported ";
}
%>
<Tr>
<Td> your operating system: </td>
<Td> <% = useros %> </td>
</Tr>
<Tr>
<Td> your browser: </td>
<Td> <% = userbrowser %> </td>
</Tr>
<Tr>
<Td> whether your machine supports gzip compression transmission: </td>
<Td> <% = gzip %> </td>
</Tr>
<Tr>
<Td> your IP address: </td>
<Td> <% = request. getRemoteAddr () %> </td>
</Tr>
</Table>
Put it in a space supporting jsp and write it on the interface to be referenced:
<Iframe src = "http://XXX.XX.jsp" width = "220" height = "200" frameborder = "0" scrolling = "No">
</IFRAME>