My JSP mini probe

Source: Internet
Author: User
Js| probe

Nothing to write a small probe play, because only embedded in the blog and so on inside so this is only to get the user information, and so I later in writing a powerful probe.

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>
&LT;TD colspan= "2" ><div align= "center" > I wrote my own JSP probe mini:) </div></td>
</tr>
<tr>
&LT;TD width= ">http" protocol version:</td>
&LT;TD width= "><%=request.getprotocol" ()%></td>
</tr>
<%
String Agent = Request.getheader ("user-agent");
StringTokenizer st = new StringTokenizer (Agent, ";");
St.nexttoken ();
Get the user's browser name
String Userbrowser = St.nexttoken ();
Get the user's operating system name
String Useros = St.nexttoken ();
Useros = useros.substring (0,useros.length ());
Determine if the user supports GZIP compression transmission
String gzip = Request.getheader ("accept-encoding");
if (Gzip.indexof ("gzip") <0)
{
gzip = "Not supported";
}
Else
{
gzip = "Support";
}
%>
<tr>
<td> the operating system you are using:</td>
<td><%=useros%></td>
</tr>
<tr>
<td> The browser you are using:</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>
&LT;TD&GT;&LT;%=REQUEST.GETREMOTEADDR ()%></td>
</tr>
</table>

In a JSP-enabled space, write on the interface you want to refer to:

<iframe src= "http://XXX.XX.jsp" width= "height=" 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.