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

📄 middle_jsp.java

📁 网上服装店 能让用户在该网站上对物品进行上传购买等操作。该设计为原版
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
		int pagecount=0; 
		int num=0;
		int count=0;
		int showpage=1;
		int i=1;
		if(!rs.next()){
		
      out.write("\r\n");
      out.write("\t\t<script language=\"javascript\">\r\n");
      out.write("\t\t\talert(\"记录集中没有记录\");\r\n");
      out.write("\t\t\thistory.back()\r\n");
      out.write("\t\t</script>\r\n");
      out.write("\t\t");

		}else{
			rs.last();
			rowcount=rs.getRow();
			String topage=request.getParameter("topage");
			pagecount=((rowcount%pagesize==0)?(rowcount/pagesize):(rowcount/pagesize+1));
			if(topage!=null){
				showpage=Integer.parseInt(topage);
				if(showpage>pagecount){
					showpage=pagecount;
				}else if(showpage<=0){
					showpage=1;
				}
			}
			rs.absolute((showpage-1)*pagesize+1);
			for(int j=1;j<=pagesize;j++){
				if(rs.isAfterLast()){
					break;
				}
					String warename=rs.getString(2);
		String wareprice=rs.getString(3);
		String waretype=rs.getString(4);
		String wareintro=rs.getString(5);
		String img=rs.getString(6);
		if(j%2!=0){
					
      out.write(" \r\n");
      out.write("        <tr> \r\n");
      out.write("          <td width=\"145\" height=\"184\" valign=\"top\"><img src=\"");
      out.print(img);
      out.write("\" width=\"145\" height=\"184\" border=\"0\"></td> \r\n");
      out.write("          <td width=\"167\" align=\"center\" valign=\"top\">\r\n");
      out.write("\t\t   <table width=\"100%\" height=\"184\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" > \r\n");
      out.write("       <tr> \r\n");
      out.write("          <td width=\"49\" height=\"30\" align=\"left\">&nbsp;名称:</td> \r\n");
      out.write("          <td width=\"95\" align=\"left\">");
      out.print(warename);
      out.write("</td>\r\n");
      out.write("        </tr> \r\n");
      out.write("\t\t<tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;类别:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(waretype);
      out.write("</td>\r\n");
      out.write("        </tr>\r\n");
      out.write("\t\t<tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;原价:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(wareprice);
      out.write("</td>\r\n");
      out.write("        </tr>\r\n");
      out.write("        <tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;现价:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(wareprice);
      out.write("</td>\r\n");
      out.write("        </tr> \r\n");
      out.write("\t\t <tr> \r\n");
      out.write("           <td height=\"30\"> &nbsp;介绍: </td>\r\n");
      out.write("\t\t   <td height=\"30\">");
      out.print(wareintro);
      out.write("</td>\r\n");
      out.write("\t\t </tr>\r\n");
      out.write("\t\t <tr> \r\n");
      out.write("          <td height=\"30\" colspan=\"2\"><center> \r\n");
      out.write("              <a href=\"user/look.jsp?buy1=");
      out.print(warename);
      out.write("\"><img src=\"images/buy.GIF\" width=\"45\" height=\"20\" class=\"btn_grey\"></a>\r\n");
      out.write("          </center></td> \r\n");
      out.write("        </tr>  \r\n");
      out.write("      </table>\t \t</td>\r\n");
      out.write("          ");

		}else{
		
      out.write("     \r\n");
      out.write("          <td width=\"145\" height=\"184\" valign=\"top\"><img src=\"");
      out.print(img);
      out.write("\" width=\"145\" height=\"184\" border=\"0\"></td> \r\n");
      out.write("          <td width=\"167\" align=\"center\" valign=\"top\"> <table width=\"100%\" height=\"184\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" > \r\n");
      out.write("       <tr> \r\n");
      out.write("          <td width=\"49\" height=\"30\" align=\"left\">&nbsp;名称:</td> \r\n");
      out.write("          <td width=\"95\" align=\"left\">");
      out.print(warename);
      out.write("</td>\r\n");
      out.write("        </tr> \r\n");
      out.write("\t\t<tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;类别:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(waretype);
      out.write("</td>\r\n");
      out.write("        </tr>\r\n");
      out.write("\t\t<tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;原价:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(wareprice);
      out.write("</td>\r\n");
      out.write("        </tr>\r\n");
      out.write("        <tr> \r\n");
      out.write("          <td height=\"30\">&nbsp;现价:</td>\r\n");
      out.write("          <td height=\"30\">");
      out.print(wareprice);
      out.write("</td>\r\n");
      out.write("        </tr> \r\n");
      out.write("\t\t <tr> \r\n");
      out.write("           <td height=\"30\"> &nbsp;介绍: </td>\r\n");
      out.write("\t\t   <td height=\"30\">");
      out.print(wareintro);
      out.write("</td>\r\n");
      out.write("\t\t </tr>\r\n");
      out.write("\t\t <tr> \r\n");
      out.write("          <td height=\"30\" colspan=\"2\"><center> \r\n");
      out.write("              <a href=\"user/look.jsp?buy1=");
      out.print(warename);
      out.write("\"><img src=\"images/buy.GIF\" width=\"45\" height=\"20\" class=\"btn_grey\"></a>\r\n");
      out.write("          </center></td> \r\n");
      out.write("        </tr>  \r\n");
      out.write("      </table>\t</td> \r\n");
      out.write("  </tr>\r\n");
      out.write("   ");

   	}
		rs.next();
		}
	}

      out.write(" \r\n");
      out.write("\t<tr align=\"right\">\r\n");
      out.write("      <td colspan=\"4\">\r\n");
      out.write("\t");

	//if(showpage!=1){
	
      out.write("\r\n");
      out.write("\t<a href=\"middle.jsp?topage=");
      out.print(1);
      out.write("\">第一页</a>\r\n");
      out.write("\t<a href=\"middle.jsp?topage=");
      out.print(showpage-1);
      out.write("\">上一页</a>\r\n");
      out.write("\t");

	//}if(showpage<pagecount){
	
      out.write("\r\n");
      out.write("\t<a href=\"middle.jsp?topage=");
      out.print(showpage+1);
      out.write("\">下一页</a>\r\n");
      out.write("\t<a href=\"middle.jsp?topage=");
      out.print(pagecount);
      out.write("\">最后一页</a>\r\n");

	//}
	con.close();

      out.write("\r\n");
      out.write("\t </td>\r\n");
      out.write("   </tr> \r\n");
      out.write("</table>\r\n");
      out.write("</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td><img name=\"usercenter_03\" src=\"image/usercenter_03.gif\" width=\"625\" height=\"4\" border=\"0\" alt=\"\"></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<br/>\r\n");
      out.write("\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write(".tit {font-size: 14px;\r\n");
      out.write("}\r\n");
      out.write(".style1 {color: #000000}\r\n");
      out.write(".style3 {font-size: 14px; font-weight: bold; }\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td height=\"30\"  align=\"center\" bgcolor=\"#f7f7f7\"><img src=\"image/pic3.gif\" align=\"absmiddle\" />  <a href=\"index.jsp\">站点首页</a> | <a href=\"about.jsp\">关于我们</a> | <a href=\"\">付款方式</a> | <a href=\"\">购物流程</a> | <a href=\"\">交易条款</a> | <a href=\"\">常见问题</a> | <a href=\"\">法律版权</a> | <a href=\"\">运输说明</a> |  <a href=\"\">售后服务</a> | <a href=\"\">送货方式</a> | <a href=\"\">新闻中心</a> | <a href=\"\">用户留言</a>\r\n");
      out.write("    </td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td align=\"right\">联系QQ:267027873  329876120<br/>\r\n");
      out.write("            客服信箱:&nbsp;&nbsp;热线:<br />\r\n");
      out.write("            公司地址:&nbsp;&nbsp;邮编:<br />\r\n");
      out.write("          Copyright&copy;&nbsp;&nbsp;&nbsp;<b></b><br/>         \r\n");
      out.write("    <span class=\"style3\"><a href=\"admin/login.htm\">后台管理登录入口</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("</body>\r\n");
      out.write("</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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -