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

📄 goodsview.jsp

📁 JSP的网上商城的代码。只是小部分。希望大家能够多看看。一起学习。
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" errorPage="" %>
<jsp:directive.page import="com.eshop.daoImpl.GoodsDaoImpl"/>
<jsp:directive.page import="com.eshop.dto.Goods"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">

.STYLE3 {font-family: "Times New Roman", Times, serif; font-size: 14px; }


.STYLE5 {
	color: #FF0000;
	font-weight: bold;
}
.STYLE8 {color: #CC0000}
.STYLE9 {color: #000066}
.STYLE22 {font-family: "Times New Roman", Times, serif; font-size: 12px; }
#Layer1 {
	position:absolute;
	left:55px;
	top:14px;
	width:520px;
	height:44px;
	z-index:1;
}
.STYLE23 {color: #000000}
body {
	background-color: #99FFFF;
}
-->
  </style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>GoodsView</title>
</head>

<body>
<%      
	    String admin = (String)session.getAttribute("AdminId");
	    if(admin != null){
		%>
<table width="603" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="82"><a href=GoodsAdd.jsp class="STYLE3" >添加商品</a></td>
    <td width="82"><a href=GoodsView.jsp class="STYLE3" >查看商品</a></td>
    <td width="82"><a href=MemberView.jsp class="STYLE3" >查看会员</a></td>
    <td width="82"><a href=MemberSeach.jsp class="STYLE3" >查找会员</a></td>
    <td width="102"><a href=order_list.jsp class="STYLE3" >查看所有订单</a></td>
    <td width="121"><a href=orderundo.jsp class="STYLE3" >查看未完成订单</a></td>
    <td width="52"><a href=index.jsp class="STYLE3" > 返回</a></td>
  </tr>
</table>
<%
	}
	else{
		response.sendRedirect("backlogin.jsp");
	}
%>
<p>  <%@include file="GoodsSeach.jsp" %>
<%
//	String admin =(String) session.getAttribute("AdminId");
	if(admin != null){
   Vector list = new Vector();
   GoodsDaoImpl gdi = new GoodsDaoImpl();
   list =  gdi.selectAll();
   for(int i= 0;i < list.size();i++)
   {   Goods g = new Goods();
       g = (Goods)list.elementAt(i);
     %>


    </p>
   <table border="0" cellspacing="1" cellpadding="0" bordercolordark="#0000FF" align="center"  bgcolor="#ECFFFF" >
     <!--DWLayoutTable-->
     <tr>
       <td width="100" rowspan="3"><img src="<%=g.getPicture() %>" width="100" height="75"></td>
       <td width="135" height="22" bgcolor="#8CEBF0" ><span class="STYLE22">品牌: <span class="STYLE23"><%=g.getBrand()%></span></span></td>
       <td colspan="2" bgcolor="#8CEBF0"><span class="STYLE22">型号: <span class="STYLE23"><%=g.getType()%></span></span></td>
       <td width="176" bgcolor="#8CEBF0"><span class="STYLE22">市场价格: <span class="STYLE8"><%=g.getNowprice()%></span></span></td>
       <td colspan="3" bgcolor="#8CEBF0"><span class="STYLE22">折扣价格: <span class="STYLE5"><%=g.getPrice() %></span></span></td>
     </tr>
     <tr>
       <td height="30" colspan="7"  bgcolor="#66FFFF"><p class="STYLE22">简介: <%=g.getIntroduc() %></p></td>
     </tr>
     <tr>
       <td height="21"><span class="STYLE22">发布日期: <span class="STYLE9"><%=g.getIntime() %></span></span></td>
       <td width="150"><span class="STYLE22">购买人数:<span class="STYLE8"> <%=g.getSaletol() %></span></span></td>
       <td colspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
       <td width="12">&nbsp;</td>
       <td width="114" valign="top" class="STYLE22"><a href="GoodsDel.jsp?id=<%=g.getId()%>"> 删除</a></td>
       <td width="74" valign="top" class="STYLE22"><a href="GoodsEdit.jsp?id=<%=g.getId()%>">修改</a></td>
     </tr>
     <tr>
       <td height="2"></td>
       <td></td>
       <td></td>
       <td width="2"></td>
       <td></td>
       <td></td>
       <td></td>
       <td></td>
     </tr>
   </table>
   <%} %>
<FORM Action="GoodsView.jsp" Method="GET">
  <p>
    <% 
	int PageSize = 10;
	int Page = 1;
	int totalPage = 1;
	int totalrecord = 0;
   if(Page != 1) {
      out.print("   <A HREF=GoodsView.jsp?Page=1>第一页</A>");
      out.print("   <A HREF=GoodsView.jsp?Page=" + (Page-1) + ">上一页</A>");
   }
   if(Page != totalPage) {
      out.print("   <A HREF=GoodsView.jsp?Page=" + (Page+1) + ">下一页</A>");
      out.print("   <A HREF=GoodsView.jsp?Page=" + totalPage + ">最后一页</A>");
   }
%>
  </p>
  <p align="center">
    <span class="STYLE1">输入页数:</span>
    <input TYPE="TEXT" Name="Page" SIZE="3"> 
    <span class="STYLE1">页数:</span><font COLOR="Red"><%=Page%>/<%=totalPage%></font></p>
<p>
</FORM>
<%
    }
	else{
		response.sendRedirect("backlogin.jsp");
	}
%>
</body>
</html>

⌨️ 快捷键说明

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