📄 categoryquery.jsp
字号:
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"%>
<%@ page import="com.cric.onlineshopclothes.dao.ProductDAO" %>
<%@ page import="com.cric.onlineshopclothes.javabean.Category" %>
<%@ page import="java.util.List" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ProductDAO dao=new ProductDAO();
List list=(List)request.getAttribute("list");
if(list==null){
list=dao.getCategoryByUsername("");
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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">
-->
</head>
<body>
<body>
<form name="form1" method="post" action="CategoryServlet">
<table width="512" border="0" cellspacing="0" cellpadding="0" height="263">
<tr>
<td width="512" bgcolor="#00FF00"><div align="center"><strong>商品类别查询</strong></div></td>
</tr>
<tr>
<td>类别名称:<input name="categoryname" type="text" size="30">
<input type="submit" name="Submit" value="查询">
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="99%" border="0" cellspacing="0" cellpadding="0" id="border">
<tr>
<td height="39" width="101" ><div align="center">编号</div></td>
<td width="101"><div align="center">类别名</div></td>
<td width="101"><div align="center">状态</div></td>
<td width="101"><div align="center">更新时间</div></td>
<td width="105" ><div align="center">操作 </div></td>
</tr>
<% for(int i=0;i<list.size();i++){
Category category=(Category)list.get(i);
%>
<tr>
<td><%=category.getCategoryId() %></td>
<td><%=category.getCategoryName() %></td>
<td><%=category.getCategoryState()%></td>
<td><%=category.getUpdateTime() %></td>
<td><div align="center"><a href="updateCategory.jsp">修改</a> </div></td>
</tr>
<%} %>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -