jsp学习笔记(15)

for(int i=0;i<type.size();i++){
typeRow = (ArrayList)type.get(i);
%>
<li><ahref="/OnlineShop/servlet/SearchServlet?types=
<%=typeRow.get(0)%>"><%=typeRow.get(1) %></a></li>
<%} }%>
left.jsp代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.util.ArrayList"%>
<body>
<jsp:include flush="true" page="/servlet/ListServlet"/>
<div id="content_left">
<div class="content_left_section">
<h1>用户登入</h1>
<form method="post" action="/OnlineShop/servlet/UserLoginServlet"
name="form1" onSubmit="return mylogin()">
<table width="200" border="0">
<tr>
<td width="50">用户名</td>
<td width="134"><input name="name" type="text" size="15" />
 </td>
</tr>
<tr>
<td height="26">密 码</td>
<td><input name="pwd" type="password" size="15" /> </td>
</tr>
<tr>
<td height="49"> </td>
<td><input type="submit" value="登入" class="mybutton" />
  <input name="" type="button" value="注册" class="mybutton"
onclick="JqueryDialog.Open('用户注册', '/OnlineShop/user/register.jsp', 600,
610);" /></td>
</tr>
<tr>
<td height="25" colspan="2">
<%
ArrayList isLogin1 = (ArrayList)session.getAttribute("login");
String loginError = (String)request.getAttribute("loginError");
if(isLogin1==null &&loginError==null){
%>
<p ><font color="red">用户未登入,无账号请先注册!</font></p>
<%}else if(isLogin1!=null &&loginError==null){
String userName = (String)isLogin1.get(3);
%>
<p><font color="red"><%=userName %>,您已登入!</font></p>
<%}else if(isLogin1==null&&"error".equals(loginError)){ %>
<p ><font color="red">用户名或密码错误!</font></p>
<%} %>
</td>
</tr>
</table>
</form>
</div>
<div class="content_left_section">
<h1>图书分类</h1>
<ul>
<%
ArrayList type = (ArrayList)request.getAttribute("type");
ArrayList typeRow = null;
if(type!=null){
for(int i=0;i<type.size();i++){
typeRow = (ArrayList)type.get(i);
%>
<li><ahref="/OnlineShop/servlet/SearchServlet?types=
<%=typeRow.get(0)%>"><%=typeRow.get(1) %></a></li>
<%} }%>
</ul>
</div>
<div class="content_left_section">
<h1>销售榜</h1>
<ul>
<%
ArrayList rank = (ArrayList)request.getAttribute("xiaosou");
ArrayList rankRow = null;
if(rank!=null){
for(int i=0;i<rank.size();i++){
rankRow = (ArrayList)rank.get(i);
%>
<li><ahref="/OnlineShop/servlet/BookinfServlet?bookId=
<%=rankRow.get(0)%>"><%=rankRow.get(1) %></a></li>
<%} }%>
</ul>
</div>
<div class="content_left_section"> <a href="javascript:void(0)"><img
style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10"
alt="" width="88" height="31" vspace="8" border="0" /></a> <a href=
"javascript:void(0)"><img style="border:0;width:88px;height:31px" src=
"http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="" vspace="8" border="0"
/></a> </div>
</div>
</body>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值