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>
<TD colspan= "2" ><div align= "center" > I wrote my own JSP probe mini:) </div></td>
</tr>
<tr>
<TD width= ">http" protocol version:</td>
<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>
<TD><%=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>