c8_005f2_jsp.java

来自「Internet 开发技术分章节代码和自己完成的课程设计全代码(在zuoye文件」· Java 代码 · 共 82 行

JAVA
82
字号
package org.apache.jsp;

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

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

  private static java.util.List _jspx_dependants;

  public Object getDependants() {
    return _jspx_dependants;
  }

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

    JspFactory _jspxFactory = null;
    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 {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      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("<html>\r\n");
      out.write("<body>\r\n");
      out.write("  <h3> 使用 application  Scope </h3><hr>\r\n");
      out.write("  <!-- 以下三句是实例化ch8_2对象。-->\r\n");
      out.write("  ");
      ch8Bean.c8_2 cn = null;
      synchronized (application) {
        cn = (ch8Bean.c8_2) _jspx_page_context.getAttribute("cn", PageContext.APPLICATION_SCOPE);
        if (cn == null){
          cn = new ch8Bean.c8_2();
          _jspx_page_context.setAttribute("cn", cn, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write(" \r\n");
      out.write("  ");
      org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("cn"), "count", "4", null, null, false);
      out.write(" <!--该语句只有创建新对象时才执行  -->\r\n");
      out.write("   ");
 cn.increase(); 
      out.write("\r\n");
      out.write("   <!-- 在网页上显示计数器结果   -->\r\n");
      out.write("   <br>  ");
      out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((ch8Bean.c8_2)_jspx_page_context.findAttribute("cn")).getCount())));
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
      out.write(" ");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?