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

📄 showadddelete.jsp

📁 基于netbeans的java桌面应用程序合集
💻 JSP
字号:
<%@page contentType="text/html" autoFlush="true"%><%@page pageEncoding="gb2312"%><%@ page import="java.sql.*" %><%@ page import="java.util.*" %><%@ page import="Adam.*" %><%!    int pageRecordNum=5;    int pageCount;%><%    String tempPageNum=request.getParameter("pageno");    try{        if(tempPageNum==null){            pageCount=1;        }else{            pageCount=Integer.parseInt(tempPageNum);        }    }catch(Exception e){        e.printStackTrace();    }%><html>    <head>        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">        <title>全部商品</title>    </head>    <body>        <form action="AdminServlet" method="post" name="result">            <input type="hidden" name="pageno" value="<%=pageCount%>"/>            <%                if(session.getAttribute("adminname")==null){                session.setAttribute("notlogin","notlogin");            %>            <jsp:forward page="login.jsp"/>            <%                }else if((session.getAttribute("showresult"))!=null){                                          %>            <table align="center" width="100%" bgcolor="dddddd" border="1" cellpadding="0" cellspacing="0">                <tr>                    <td>商品编号</td>                    <td>商品名称</td>                    <td>商品价格</td>                    <td>库存数量</td>                    <td>商品描述</td>                    <td>&nbsp;</td>                </tr>                  <%                    Vector vec=(Vector)session.getAttribute("showresult");                    int size=vec.size();                    for(int i=(pageCount-1)*5;i<(pageCount-1)*5+pageRecordNum;i++){                        ProductBean tempbean=(ProductBean)vec.elementAt(i);                        int productId=tempbean.getProductId();                                    %>                <tr>                    <td><%=productId%></td>                    <td><%=tempbean.getProductName()%></td>                    <td><%=tempbean.getProductPrice()%></td>                    <td><%=tempbean.getProductNum()%></td>                    <td><%=tempbean.getProductDescribe()%>&nbsp;</td>                    <td><a href="AdminServlet?productId=<%=productId%>&pageno=<%=pageCount%>&action=delete">删除</a></td>                </tr>                <%                    if(i>=size-1)                        break;                        }                %>            </table>            <%                if(pageCount!=1){            %>            <a href="AdminServlet?action=previous&pageno=<%=pageCount-1%>">上一页</a>            <%                }                    int lastPageNum=size/pageRecordNum;                    if(size%pageRecordNum!=0){                        lastPageNum++;                    }if(pageCount!=lastPageNum){            %>            <a href="AdminServlet?action=next&pageno=<%=pageCount+1%>">下一页</a>            <%                }            %>            <br>共<%=lastPageNum%>页,当前第<%=pageCount%>页<br>            <a href="AdminServlet?action=add">添加新商品</a>            <%                }            %>        </form>            </body></html>

⌨️ 快捷键说明

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