productinfo_jsp.java

来自「精通EJB3.0一书的全部随书实例的源代码。」· Java 代码 · 共 73 行

JAVA
73
字号
package examples;

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

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

  private static java.util.Vector _jspx_dependants;

  public java.util.List 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");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			"error.jsp", 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\r\n\r\n<html>\r\n    <head><title> Jasmine's Product Info page</title></head>\r\n    <body>\r\n        ");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "title.jsp", out, false);
      out.write("   \r\n\t\r\n\t    \r\n        ");
    
	 //Retrieves the productItem from request object and displays.        
         ProductItem item=(ProductItem)request.getAttribute("productItem");
        
      out.write("\r\n        \r\n      <b>");
      out.print(item.getName());
      out.write("<b>\r\n      <h4> Description:</h4>\r\n       ");
      out.print(item.getDescription());
      out.write(" \r\n      <h4>Base price (before discounts):");
      out.print(item.getBasePrice());
      out.write("</h4> \r\n\r\n      <center>\r\n      <A href=\"/jasmine/catalog?Buy=");
      out.print(item.getProductID());
      out.write("\">Add this item to Cart</A><br>\r\n      <A href=\"/jasmine/catalog\">See the Catalog</A><br>\r\n      <A href=\"/jasmine/showQuote\">View Current Shopping Cart</A>\r\n\r\n        ");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "footer.jsp", out, false);
      out.write("\r\n\r\n     </center>\r\n   </body>\r\n</html>\r\n");
    } 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 + -
显示快捷键?