package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.io.*;
import java.util.*;
import java.net.*;

public final class jsp_005fcheck_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {


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();
}

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n");
      out.write("<title>jsp探针</title>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("body,td,th {\r\n");
      out.write("font-size: 9pt;\r\n");
      out.write("}\r\n");
      out.write("body {\r\n");
      out.write("margin-left: 0px;\r\n");
      out.write("margin-top: 0px;\r\n");
      out.write("margin-right: 0px;\r\n");
      out.write("margin-bottom: 0px;\r\n");
      out.write("}\r\n");
      out.write("a:link {\r\n");
      out.write("text-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:visited {\r\n");
      out.write("text-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:hover {\r\n");
      out.write("text-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:active {\r\n");
      out.write("text-decoration: none;\r\n");
      out.write("}\r\n");
      out.write(".STYLE4 {color: #000000}\r\n");
      out.write(".STYLE5 {font-weight: bold; font-size: 10pt;}\r\n");
      out.write(".STYLE7 {font-size: 10}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("<table align=\"center\" width=\"277\" border=\"0\">\r\n");
      out.write("<tr>\r\n");
      out.write("<td width=\"90\" align=\"center\">JSP探针 v1.1 </td>\r\n");
      out.write("<td width=\"85\" align=\"center\">&nbsp;</td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<div align=\"center\"><br>\r\n");
      out.write("<table width=\"");
      out.print(tblWidth);
      out.write("\" align=\"");
      out.print(tblAlign);
      out.write("\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\r\n");
      out.write("<tr>\r\n");
      out.write("<td colspan=\"2\" height=\"22\" bgcolor=\"#E0E0E0\"><span class=\"STYLE5\">服务器基本信息\r\n");
      out.write("</span> </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >服务器名称</td>\r\n");
      out.write("<td>");
      out.print( request.getServerName() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >域名/IP </td>\r\n");
      out.write("<td>");
      out.print( request.getServerName() );
      out.write('\r');
      out.write('\n');
      out.print(getIp());
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">服务器端口 </td>\r\n");
      out.write("<td>");
      out.print( request.getServerPort() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">客户端端口 </td>\r\n");
      out.write("<td>");
      out.print( request.getRemotePort() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">客户端IP </td>\r\n");
      out.write("<td>");
      out.print( request.getRemoteAddr() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">Web 服务器 </td>\r\n");
      out.write("<td>");
      out.print( application.getServerInfo() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">操作系统 </td>\r\n");
      out.write("<td>");
      out.print( strOS+" "+System.getProperty("sun.os.patch.level")+" Ver:"+System.getProperty("os.version") );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">服务器时间 </td>\r\n");
      out.write("<td>");
      out.print(new Date().toLocaleString());
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >CPU 信息 </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("os.arch"));
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >磁盘分区 </td>\r\n");
      out.write("<td>");
      out.print( getDrivers());
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >用户当前工作目录 </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("user.dir"));
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\">本文件路径 </td>\r\n");
      out.write("<td>");
      out.print( application.getRealPath(request.getRequestURI()) );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br>\r\n");
      out.write("<table width=\"");
      out.print(tblWidth);
      out.write("\" align=\"");
      out.print(tblAlign);
      out.write("\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\r\n");
      out.write("<tr>\r\n");
      out.write("<td colspan=\"2\" height=\"22\" bgcolor=\"#E0E0E0\"><span class=\"STYLE4\"><span class=\"STYLE5\">Java 相关信息</span></span> </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" ><span class=\"STYLE7\">JDK 版本</span> </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("java.version") );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >Servlet 版本 </td>\r\n");
      out.write("<td>");
      out.print( application.getMajorVersion()+"."+application.getMinorVersion() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >JDK 安装路径 </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("java.home"));
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >编码 </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("file.encoding"));
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td height=\"23\" width=\"20%\" >JAVA类路径 </td>\r\n");
      out.write("<td>");
      out.print( System.getProperty("java.class.path"));
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br>\r\n");
      out.write("<table width=\"");
      out.print(tblWidth);
      out.write("\" align=\"");
      out.print(tblAlign);
      out.write("\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\r\n");
      out.write("<tr>\r\n");
      out.write("<td colspan=\"2\" height=\"22\" bgcolor=\"#E0E0E0\">服务器环境变量 </td>\r\n");
      out.write("</tr>\r\n");
      out.write("<tr>\r\n");
      out.write("<td colspan=\"2\">");
      out.print( getSystemEnv() );
      out.write(" </td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");
      out.write("</div>\r\n");
      out.write("</body>\r\n");
      out.write("</html");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
