📄 fl_old.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="includesp.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'fl.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
#zong{ margin:0 auto;
width:950px;
height:auto;
border:1px solid blue;
float:left;
}
#zuo{
float:left;
width:270px;
margin:4px 5 7px 5px;
}
#login{
width:260px;
margin:4px 5 7px 5px;
}
#fenlei{
width:260px;
margin:4px 5 7px 5px;
}
#spxs{
float:left;
width:650px;
margin:4px 5 7px 5px;
}
#spwz{
float:left;
width:110px;
height:240px;
margin:15px;
}
#di{
clear:both;
width:450px;
}
</style>
</head>
<body>
<div id="zong">
<%
String zxuser=request.getParameter("zxuser");
if(zxuser!=null && !"".equals(zxuser))
{
session.setAttribute("isname",null);
session.setAttribute("name",null);
session.setAttribute("userid",null);
gwc.qingkong();
}
%>
<div id="zuo">
<div id="login">
<%
String isname=(String)session.getAttribute("isname");
String user=(String)session.getAttribute("name");
String userid=(String)session.getAttribute("userid");
if(isname == null || !isname.equals("true"))
{
%>
<form action="check.jsp" method="post" >
<table>
<tr><td><a href="adduser.jsp">点击注册</a></td></tr>
<tr><td>用户名:</td><td><input type="text" name="name" /><br></td></tr>
<tr><td>密 码 :</td><td><input type="password" name="pass" /><br></td><tr>
<tr><td></td><td align="right">
<input type="reset" value="重置" />
<input type="submit" name="lonin" value="登录" /></td><tr>
</table>
</form>
<%
}else {
%>
<form action="index.jsp" method="post" >
<table>
<tr><td align="center">欢迎<%=user %>光临<td></tr>
<tr><td><a href="userinfo.jsp?userid=<%=userid %>">点击查看个人信息</a><td></tr>
<tr><td align="right">
<input type="hidden" name="zxuser" value="zhuxiao" />
<input type="submit" value="注销" /></td></tr>
</table>
</form>
<%
}
%>
</div>
<div id="fenlei">
<p>请选择分类</p>
<ul>
<li><a href="fl.jsp?fl=tushu">图书</a></li>
<li><a href="fl.jsp?fl=shouji">手机类</a></li>
<li><a href="fl.jsp?fl=shenghuo">生活用品类</a></li>
<li><a href="fl.jsp?fl=bijiben">笔记本电脑类</a></li>
<li><a href="fl.jsp?fl=qita">其他</a></li>
</ul>
</div>
</div>
<div id="spxs">
<%
request.setCharacterEncoding("utf-8");
String fl=request.getParameter("fl");
if (null == fl) //空字符id判断
{
response.sendRedirect("index.jsp");
return;
}
String fl2="";
if(fl.equals("tushu")) fl2="图书";
if(fl.equals("shouji")) fl2="手机";
if(fl.equals("bijiben")) fl2="笔记本电脑";
if(fl.equals("qita")) fl2="其他";
if(fl.equals("shenghuo")) fl2="生活用品";
%>
<h2><%=fl2%>类商品:</h2><br>
<%
Collection cl=dosp.getSpFl(fl);
Iterator it=cl.iterator();
%>
<%
while(it.hasNext())
{
SpDX sp=(SpDX)it.next();
String name=sp.getName();
int id=sp.getId();
float jg=sp.getJg();
%>
<div id="spwz" align="center">
<img src="img/no1.jpg" /><br>
<a href="spinfo.jsp?id=<%=id %>"> <%=name%> </a><br>
价格:<%=jg%><br>
<% if (gwc.ifYes(new Integer(id)))
{
out.println("已在购物车中<br>");
}
else
{
%>
<a href="fl.jsp?add=<%=id%>&fl=<%=fl %>">加入购物车</a><!--添加返回-->
<br>
<%
}
%>
</div>
<%
}
%>
<div id="di"><p>购物车中现有<%=gwc.getZsl()%>件商品
<a href="showgwc.jsp">查看购物车</a></p>
</div>
</div>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -