⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.jsp

📁 对入学者很实用用JAVA的基本语言写的
💻 JSP
字号:
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <base href="${pageContext.request.requestURL}"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <link href="css/styles.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript">
<!--
   function onSelect(checked) {
     var checkboxs = document.getElementsByName("usid");
     for (var i=0;i<checkboxs.length;i++){
        checkboxs[i].checked=checked;
     }
   }
   function onAdd(){
      window.location="userAdd.do";
   }
   function onDownload(){
     window.open("download.do?usid=164");
   }
   function onDel(){
     document.forms[0].action="delete.jsp";
     document.forms[0].submit();
   }
   function onEdit(){
     document.forms[0].action="userEdit.do";
     document.forms[0].submit();
   }
   var tom;
   function onMove(){
      var div = document.getElementById("advDiv");
      div.style.pixelTop = div.style.pixelTop+10;
      div.style.pixelLeft = div.style.pixelLeft+10;
      if (div.style.pixelTop>600){
        div.style.pixelTop=10;
        div.style.pixelLeft=10;
      }
      if (div.style.pixelLeft>800){
        div.style.pixelLeft=10;
        div.style.pixelTop=10;
      }
      tom=window.setTimeout("onMove()", 300);
   }
   function onStop(){
      window.clearTimeout(tom);
   }
   function onClose(){
     var div = document.getElementById("advDiv");
     window.clearTimeout(tom);
     div.style.display ='none';
   }
//-->
</script>
    </head>
    <body>
        <div id="container">
            <div id="head">
                <img src="images/head.jpg" />
            </div>
            <div id="nav">
                <span style="float: left">你好:${LoginName}</span>
                <ul>
                    <li>
                        <a href="../Main.jsp">主页</a>
                    </li>
                    <li>
                        <html:link action="/chaxun">用户管理</html:link>
                    </li>
                    <li>
                        <a href="">MVC</a>
                    </li>
                    <li>
                        <a href="../LogoutServlet">退出</a>
                    </li>
                </ul>
            </div>
            <div id="body">
                <div class="title">
                    用户管理<span style="color: red;"><html:errors/></span>
                </div>
                <html:form action="/userPk">
                <div id="contentDiv">
                    <table cellspacing="0">
                        <caption align="right">
                            记录数:${fn:length(rows)}</caption>
                        <thead>
                            <tr>
                                <th width="50px">
                                   
                                    <input type="checkbox"
                                        onclick="javascript:onSelect(this.checked);"
                                    >
                                </th>
                                <th>
                                    用户名
                                </th>
                                <th>
                                    电子邮箱
                                </th>
                                <th>
                                    出生地
                                </th>
                                <th>
                                    婚姻状况
                                </th>
                                <th>
                                    出生年月
                                </th>
                                <th>
                                    年薪1
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                          <c:forEach var="row" items="${rows}" varStatus="status">
                                <c:if test="${status.index%2==1}">
                                    <c:set var="rowClass" value="row1" />
                                </c:if>
                                <c:if test="${status.index%2==0}">
                                    <c:set var="rowClass" value="row2" />
                                </c:if>
                                <tr class="${rowClass}">
                                    <td>
                                      <html:multibox property="usid" value="${row.userid}"></html:multibox>
                                    </td>
                                    <td>
                                        <c:out value="${row.username}"></c:out>
                                    </td>
                                    <td>
                                        ${row.email}
                                    </td>
                                    <td>
                                        ${row.area}
                                    </td>
                                    <td> 
                                        ${row.married}
                                    </td>
                                    <td>
                                       <fmt:formatDate value="${row.birth}" pattern="yyyy-MM-dd"/>
                                    </td>
                                    <td>
                                       <fmt:formatNumber value="${row.salary}" pattern="#,###.##元"/>
                                    </td>
                                </tr>
                            </c:forEach>
                        </tbody>
                    </table>
                    
                </div>
                <div>
                    <input type="button" value="编辑" class="button" onclick="javascript:onEdit();"/>
                    <input type="button" value="删除" class="button" onclick="javascript:onDel();"/>
                    <input type="button" value="增加" class="button" onclick="javascript:onAdd();"/>
                    <input type="button" value="下载" class="button" onclick="javascript:onDownload();"/>
                </div>
               </html:form>
            </div>
            <div id="foot">
                校址:南京市解放路101号6楼 电话:025-84455877
                <br />
                Copyright © 2006 北大青鸟南京协同校区--软件工程师培训中心 版权所有
            </div>
        </div>
        <div id="advDiv" onmouseout="javascript:onMove();"
            onmouseover="javascript:onStop();"
        >
            <div>
              <html:img page="/showPic.do?usid=165" width="100" height="70"/>
            </div>
            <a href="javascript:void(0);" onclick="javascript:onClose();">关闭</a>
        </div>
    </body>
</html>

⌨️ 快捷键说明

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