?? product.jsp
字號:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="crm.web.action.other.*" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%!int p=1;%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Integer sum=(Integer)session.getAttribute("sum");
String p1= request.getParameter("p");
String p2= request.getParameter("p2");
if((p1==null || "".equals(p1))&&(p2==null || "".equals(p2)))
{
p1="1";
}
else if(p2!=null)
{
p1=p2;
}
int p = Integer.parseInt(p1);
//總頁數
int s =(sum+5-1)/5;
%>
<html>
<html:base/>
<head>
<title>jb-aptech畢業設計項目</title>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script src="../script/common.js"></script>
</head>
<body>
<form action="<%=path %>/product.do" method="post">
<input type="hidden" name="flag" value="search"/>
<div class="page_title">產品查詢</div>
<div class="button_bar">
<button class="common_button" onclick="help('');">幫助</button>
<button class="common_button" type="submit">查詢</button>
</div>
<table class="query_form_table">
<tr>
<th>名稱</th>
<td><input name="entity.prodName"/></td>
<th>型號</th>
<td><input name="entity.prodType"/></td>
<th>批次</th>
<td><input name="entity.prodBatch"/></td>
</tr>
</table>
</form>
<br />
<table class="data_list_table">
<tr>
<th>編號</th>
<th>名稱</th>
<th>型號</th>
<th>等級/批次</th>
<th>單位</th>
<th>單價(元)</th>
<th>備注</th>
</tr>
<logic:iterate id="chanpin" name="list" scope="request">
<tr>
<td class="list_data_number"><bean:write name="chanpin" property="prodId"/></td>
<td class="list_data_ltext"><bean:write name="chanpin" property="prodName"/></td>
<td class="list_data_text"><bean:write name="chanpin" property="prodType"/></td>
<td class="list_data_text"><bean:write name="chanpin" property="prodBatch"/></td>
<td class="list_data_text"><bean:write name="chanpin" property="prodUnit"/></td>
<td class="list_data_number"><bean:write name="chanpin" property="prodPrice"/></td>
<td class="list_data_ltext"><bean:write name="chanpin" property="prodMemo"/></td>
</tr>
</logic:iterate>
<tr>
<th colspan="100" class="pager">
<div class="pager">
總頁數:<%=s%> 當前頁:<%=p%> 每頁顯示5條;
<%if(p!=1){ %>
<a href="<%=path %>/product.do?flag=list&p=<%=1%>">首頁</a>
<a href="<%=path %>/product.do?flag=list&p=<%=p-1%>">上一頁</a>
<% } %>
<%if(p!=s&&p<s){ %>
<a href="<%=path %>/product.do?flag=list&p=<%=p+1%>">下一頁</a>
<a href="<%=path %>/product.do?flag=list&p=<%=s%>">尾頁</a>
<% } %>
</div>
</th>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -