productweight_jsp.java

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

JAVA
107
字号
package org.apache.jsp;

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

public final class ProductWeight_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("<HEAD>\r\n");
      out.write("<TITLE>使用Javabeans</TITLE>\r\n");
      out.write("</HEAD>\r\n");
      out.write("<BODY>\r\n");
      pWeight.ProductWeight pw = null;
      synchronized (application) {
        pw = (pWeight.ProductWeight) _jspx_page_context.getAttribute("pw", PageContext.APPLICATION_SCOPE);
        if (pw == null){
          pw = new pWeight.ProductWeight();
          _jspx_page_context.setAttribute("pw", pw, PageContext.APPLICATION_SCOPE);
        }
      }
      out.write(" \r\n");
      out.write("修改前\r\n");
      out.write("<BR>使用getProperty取得Bean的属性值\r\n");
      out.write("<BR>产品型号 : ");
      out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((pWeight.ProductWeight)_jspx_page_context.findAttribute("pw")).getProduct())));
      out.write("\r\n");
      out.write("<BR>产品重量 : ");
      out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((pWeight.ProductWeight)_jspx_page_context.findAttribute("pw")).getWeight())));
      out.write("\r\n");
      out.write("<BR><BR>使用类中定义的方法获取产品的属性值\r\n");
      out.write("<BR>产品型号 :");
      out.print(pw.getProduct() );
      out.write("\r\n");
      out.write("<BR>产品重量 :");
      out.print(pw.getWeight() );
      out.write('\r');
      out.write('\n');
      org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("pw"), "product", "k1568", null, null, false);
      out.write('\r');
      out.write('\n');
      org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(_jspx_page_context.findAttribute("pw"), "weight", "35", null, null, false);
      out.write("\r\n");
      out.write("<HR><BR>修改后\r\n");
      out.write("<BR>使用getProperty取得Bean的属性值\r\n");
      out.write("<BR>产品型号 : ");
      out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((pWeight.ProductWeight)_jspx_page_context.findAttribute("pw")).getProduct())));
      out.write("\r\n");
      out.write("<BR>产品重量 : ");
      out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((pWeight.ProductWeight)_jspx_page_context.findAttribute("pw")).getWeight())));
      out.write("\r\n");
      out.write("<BR><BR>使用类中定义的方法获取产品的属性值\r\n");
      out.write("<BR>产品型号 :");
      out.print(pw.getProduct() );
      out.write("\r\n");
      out.write("<BR>产品重量 :");
      out.print(pw.getWeight() );
      out.write("\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)
          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 + -
显示快捷键?