<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%>
<%@ page language= "java" import= "java.io.*,java.net.*"%>
<%@ taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
<%@ include file= "/manager/common/common.jsp"%>
<%!
String tblwidth = "700";
String tblalign = "center";
String StrOS =system.getproperty ("Os.name");
Private String GetIP ()
{
String strtmp= "";
Try
{
Strtmp =inetaddress.getlocalhost (). gethostaddress ();
return strtmp;
}
catch (Exception e)
{
return strtmp;
}
}
Private String getsystemenv () throws Exception
{
String OS = System.getproperty ("Os.name"). toLowerCase ();
StringBuffer sb=new StringBuffer ("");
Process P=null;
if (Os.indexof ("Windows") >-1)
{
P=runtime.getruntime (). EXEC ("cmd/c set");
}
Else
{
P=runtime.getruntime (). EXEC ("/bin/sh-c set");
}
BufferedReader br=new BufferedReader (New InputStreamReader (P.getinputstream ()));
String Line;
while ((Line=br.readline ())!=null)
{
Sb.append (line+ "<br>");
}
return sb.tostring ();
}
Private String getdrivers ()
{
StringBuffer sb=new StringBuffer ("");
File roots[]=file.listroots ();
for (int i=0;i<roots.length;i++)
{
Sb.append (roots[i]+ "");
}
return sb.tostring ();
}
%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title>jsp Probe </title>
<style type= "Text/css" >
<!--
Body,td,th
{
font-size:9pt;
}
Body
{
margin-left:0px;
margin-top:0px;
margin-right:0px;
margin-bottom:0px;
}
A:link
{
Text-decoration:none;
}
a:visited
{
Text-decoration:none;
}
A:hover
{
Text-decoration:none;
}
A:active
{
Text-decoration:none;
}
. STYLE4 {color: #000000}
. STYLE5 {font-weight:bold; font-size:10pt;}
. STYLE7 {Font-size:10}
-
</style>
<body>
<table align= "center" width= "277" border= "0" >
<tr>
<TD width= "" align= "center" >jsp probe </td>
</tr>
</table>
<div align= "center" ><br>
<table width= "<%=tblWidth%>" align= "<%=tblAlign%>" border= "0" cellspacing= "0" cellpadding= "1" >
<tr>
<TD colspan= "2" height= "bgcolor=" #E0E0E0 "><span class=" STYLE5 "> server basic information
</span> </td>
</tr>
<tr>
<TD height= "width=" 20% "> server name </td>
<td> <%= request.getservername ()%> </td>
</tr>
<tr>
<TD height= "width=" 20% "> domain/IP </td>
<td> <%= Request.getservername ()%>
<%=getip ()%> </td>
</tr>
<tr>
<TD height= "" > Server port </td>
<td> <%= request.getserverport ()%> </td>
</tr>
<tr>
<TD height= "All" > client ports </td>
<td> <%= request.getremoteport ()%> </td>
</tr>
<tr>
<TD height= "All" > client IP </td>
<td> <%= request.getremoteaddr ()%> </td>
</tr>
<tr>
<TD height= "> " Web Server </td>
<td> <%= application.getserverinfo ()%> </td>
</tr>
<tr>
<TD height= "> os </td>
<td> <%= stros+ "" +system.getproperty ("sun.os.patch.level") + "Ver:" +system.getproperty (" Os.version ")%> </td>
</tr>
<tr>
<TD height= "> server time </td>
<td> <%=new Date (). toLocaleString ()%> </td>
</tr>
<tr>
<TD height= "" Width= "20%" > CPU Information </td>
<td> <%= system.getproperty ("Os.arch")%> </td>
</tr>
<tr>
<TD height= "width=" 20% "> disk Partitions </td>
<td> <%= getdrivers ()%> </td>
</tr>
<tr>
<TD height= "width=" 20% "> user current working directory </td>
<td> <%= system.getproperty ("User.dir")%> </td>
</tr>
<tr>
<TD height= "All" > this file path </td>
<td> <%= Application.getrealpath (Request.getrequesturi ())%> </td>
</tr>
</table>
<br>
<table width= "<%=tblWidth%>" align= "<%=tblAlign%>" border= "0" cellspacing= "0" cellpadding= "1" >
<tr>
<TD colspan= "2" height= "bgcolor=" #E0E0E0 "><span class=" STYLE4 "> <span class=" STYLE5 " >java Related Information </span></span> </td>
</tr>
<tr>
<TD height= "width=" 20% "><span class=" STYLE7 "> JDK versions </span> </td>
<td> <%= system.getproperty ("java.version")%> </td>
</tr>
<tr>
<TD height= "" Width= "20%" > Servlet version </td>
<td> <%= application.getmajorversion () + "." +application.getminorversion ()%> </td>
</tr>
<tr>
<TD height= "" Width= "20%" > JDK Installation Path </td>
<td> <%= system.getproperty ("Java.home")%> </td>
</tr>
<tr>
<TD height= "" Width= "20%" > encoding </td>
<td> <%= system.getproperty ("file.encoding")%> </td>
</tr>
<tr>
<TD height= "" Width= "20%" > Java classpath </td>
<td> <%= system.getproperty ("Java.class.path")%> </td>
</tr>
</table>
<br>
<table width= "<%=tblWidth%>" align= "<%=tblAlign%>" border= "0" cellspacing= "0" cellpadding= "1" >
<tr>
<TD colspan= "2" height= "All" bgcolor= "#E0E0E0" > Server environment variables </td>
</tr>
<tr>
<TD colspan= "2" ><%= getsystemenv ()%> </td>
</tr>
</table>
<br>
</div>
</body>
JSP Miniature probe Demo