⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prouctinfo.jsp

📁 java编写的网络购物简洁版
💻 JSP
字号:
<%@page contentType="text/html; charset=GB2312"%>
<%@include file="common.jsp"%>
<jsp:useBean id="cart" scope="session"
             class="shop.CartBean"/>

<html>
    <head><title>欢迎光临网上书店</title></head>
    <body>
        <jsp:include page="gouwuche/additem.jsp" flush="false"/>
        
        <%
            String id = request.getParameter("id");
           if (null == id || "".equals(id))
            {
		%>
		
		<jsp:forward page="catalog.jsp" />
		
		<%
            }
           else
            {
              int productId = Integer.parseInt(id);
                productBean pBean = pDAO.getproduct(productId);
        %>
        <table border="1">
            <tr>
                <th>商品</th>
                <th>描述</th>
                <th>价格</th>
                <th>数量</th>
                <th>备注</th>
            </tr>
            <tr>
                <td><%=pBean.getProductName() %></td>
                <td><%=pBean.getFactory() %></td>
                <td><%=pBean.getPrice() %></td>
                <td><%=pBean.getAmout() %></td>
                <td><%=pBean.getRemark() %></td>
            </tr>
        </table>
        <%
              if (cart.isExist(new Integer(productId)))
                {
                    out.println("该商品已在购物车中<br>");
                }
              else
                {
        %>
        <a href="prouctinfo.jsp?add=<%=productId%>&id=<%=productId%>">加入购物车</a>
        <br>
        <%
                }
        %>
        购物车中现有<%=cart.getNumOfItems()%>种图书
        &nbsp;&nbsp;&nbsp;&nbsp;
        <a href="showcart.jsp">查看购物车</a>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <a href="catalog.jsp">查看所有图书</a>
        <%
            }
        %>
    </body>
</html>

⌨️ 快捷键说明

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