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>