list.jsp

来自「系统分为用户模块和管理员模块两大部分。 普通用户只能查看、搜索和购买图书。搜索」· JSP 代码 · 共 77 行

JSP
77
字号
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld" %><%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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 'list.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">
    -->
    
    <script language="javascript">
       function myadd(){
	   document.location.href="<%=path%>/jsp/bookcategory/add.jsp";
       }
       
       function  confirmIt(n){
            
                if(confirm("删除将无法恢复,是否确认删除?")){
                	self.location=n;
                }else{
                	return false;
                }
            } 
    </script>
    
  </head>
  
  
  <body>
        <TABLE align="center" border="1">

    	<TR>
    		<TH>类别编号</TH><TH>类别名</TH><TH colspan="2">操作</TH>
    	</TR>
    	<logic:iterate id="element" name="bookCategoryDTOs">
				<tr>
				    <td>
						<bean:write name="element" property="id" />
					</td>

					<td>
						<bean:write name="element" property="category" />
					</td>
					
					<td >
<span style="cursor:hand" onclick="confirmIt('<%=path%>/bookcategory_delete.do?id=<bean:write name="element" property="id" />')">[ 删 除 ]</span>					
 					</td>
					<td >					
                        <A href="<%=path%>/jsp/bookcategory/edit.jsp?id=<bean:write name="element" property="id" />
        			&category=<bean:write name="element" property="category" />">修改</A>
					</td>
 			</tr>
 			
 		</logic:iterate>
    </TABLE>
    <CENTER>
    		<input type="button" name="add" value="添加类别" onClick="myadd()">
    </CENTER>   
  </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?