package org.apache.jsp;

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

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

  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=gb2312");
      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("<HTML>\r\n");
      out.write("<HEAD>\r\n");
      out.write("<TITLE>JSP Info</TITLE>\r\n");
      out.write("<META http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("<STYLE type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("body {  font-family: \"Tahoma\", \"Verdana\"; font-size: 12px; color: #333333}\r\n");
      out.write("td {  font-family: \"Tahoma\", \"Verdana\"; font-size: 12px; color: #333333}\r\n");
      out.write("-->\r\n");
      out.write("</STYLE>\r\n");
      out.write("</HEAD>\r\n");
      out.write("\r\n");
      out.write("<BODY bgcolor=\"#FFFFFF\" text=\"#000000\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"0\" marginheight=\"0\">\r\n");
      out.write("<TABLE width=\"80%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\r\n");
      out.write("  <TR> \r\n");
      out.write("    <TD colspan=\"2\" bgcolor=\"#8CC2E3\"><B>JSP Info</B> v1.0</TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR> \r\n");
      out.write("    <TD colspan=\"2\" bgcolor=\"#DEEEF8\">Author: Snowman &nbsp; &nbsp; &nbsp; Web: \r\n");
      out.write("      <A href=\"http://www.xinboard.net\" target=\"_blank\"><FONT color=\"#333333\"><U>http://www.xinboard.net</U></FONT></A></TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#FFFFFF\"> \r\n");
      out.write("    <TD colspan=\"2\" height=\"50\">&nbsp;</TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#B4D8ED\"> \r\n");
      out.write("    <TD width=\"30%\"><B>Environment (环境)</B></TD>\r\n");
      out.write("    <TD width=\"70%\"><B>Values (值)</B></TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#DEEEF8\"> \r\n");
      out.write("    <TD bgcolor=\"#DEEEF8\">Server name (服务器名称)</TD>\r\n");
      out.write("    <TD>");
      out.print( request.getServerName() );
      out.write("</TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#DEEEF8\"> \r\n");
      out.write("    <TD>Server port (服务器端口)</TD>\r\n");
      out.write("    <TD>");
      out.print( request.getServerPort() );
      out.write("</TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#DEEEF8\"> \r\n");
      out.write("    <TD>Remote IP address (客户端IP地址)</TD>\r\n");
      out.write("    <TD>");
      out.print( request.getRemoteAddr() );
      out.write("</TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  <TR bgcolor=\"#DEEEF8\"> \r\n");
      out.write("    <TD colspan=\"2\"><B>Context attributes (相关属性)</B></TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("  ");

	ServletContext context = getServletContext();
	Enumeration enum = context.getAttributeNames();
	while (enum.hasMoreElements()) {
	    String key = (String)enum.nextElement();
            Object value = context.getAttribute(key);
            out.println("<TR bgcolor=#DEEEF8><TD>" + key + "</TD><TD>" + value + "</TD></TR>");
	}


      out.write("\r\n");
      out.write("  <TR bgcolor=\"#FFFFFF\" valign=\"bottom\"> \r\n");
      out.write("    <TD colspan=\"2\" height=\"50\"><B>End (结束)</B></TD>\r\n");
      out.write("  </TR>\r\n");
      out.write("</TABLE>\r\n");
      out.write("</BODY>\r\n");
      out.write("</HTML>\r\n");
    } 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);
    }
  }
}
