My jsp mini Probe

Source: Internet
Author: User


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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.