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

📄 viewuser.tag

📁 一个基于JAVA的BS结构的宠物诊所管理系统.是当年在学校时写的,大家指点一下.
💻 TAG
字号:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@tag pageEncoding="GBK"%>
<%@tag  import="java.util.*" %>
<%@tag  import="gxaccp.t07.guoneng_wei.petclinicmanagesystem.actionform.*" %>

<script type="" language="JavaScript">

      function jumping(){
        //下拉菜单的动作
        document.pageForm.submit();
      }

      function gotoPage(pagenum){
        //点击上下页链接的动作
        document.pageForm.jumpPage.value=pagenum;
        document.pageForm.submit();
        return;
      }

      function deleteUser(id,pageNumber){
         document.deleteUserForm.userID.value=id;
         document.deleteUserForm.jumpPage.value=pageNumber;
         document.deleteUserForm.submit();
      }
</script>
<FORM name="deleteUserForm" action="deleteUser.do" method="POST" >
<input type="hidden" name="userID"/>
<input type="hidden" name="jumpPage" />
</form>
<%-- ---------------------------------------------------------------- --%>
      <c:choose>
        <%-- 防止数据库里没有读出数据 但这是不可能的 --%>
        <c:when test="${not empty requestScope.UserInfoPage}">
          <%-- 有数据从Action传来 开始--%>
          <table align="center" border="1" width="90%" bordercolor="#FF9900">
            <tr>
              <th>用户名:</th><th>密码</th><th>权限/角色</th><th>&nbsp;</th>
            </tr>

            <c:forEach items="${requestScope.UserInfoPage.data}" varStatus="stat" var="userObj">
              <tr>
                <td>${userObj.userName}</td>
                <td>${userObj.userPassword}</td>
                <td>${userObj.admin ?'管理员':'普通用户' }</td>
                <td><a href="javascript:deleteUser(${userObj.userID},${UserInfoPage.currentPage});">删除</a></td>
              </tr>
            </c:forEach>
          </table>

          <br />
          <form name="pageForm" action="searchUserInfo.do" method="POST">
            <table align="center" width="50%">
              <tr>
                <td>每页${UserInfoPage.rowsPerPage}行</td>
                <td>共${UserInfoPage.maxRowCount}行</td>
                <td>当前第${UserInfoPage.currentPage}页</td>
                <td>共${UserInfoPage.maxPage}页</td>
                <td>&nbsp;</td>
              </tr>

              <tr>
                  <c:choose>
                    <c:when test="${UserInfoPage.currentPage==1}">
                      <td>首页</td>
                      <td>上一页</td>
                    </c:when>
                    <c:otherwise>
                      <td><a href="javascript:gotoPage(1);">首页</a></td>
                      <td><a href="javascript:gotoPage(${UserInfoPage.currentPage-1});">上一页</a></td>
                    </c:otherwise>
                  </c:choose>

                <c:choose>
                  <c:when test="${UserInfoPage.currentPage==UserInfoPage.maxPage}">
                    <td>下一页</td>
                    <td>尾页</td>
                  </c:when>
                  <c:otherwise>
                    <td><a href="javascript:gotoPage(${UserInfoPage.currentPage+1});">下一页</a></td>
                    <td><a href="javascript:gotoPage(${UserInfoPage.maxPage});">尾页</a></td>
                  </c:otherwise>
                </c:choose>
                <td>
                  转到第<select name="jumpPage" onchange="javascript:jumping();">
                    <c:forEach begin="1" end="${UserInfoPage.maxPage}" varStatus="stat">
                      <c:choose>
                        <c:when test="${stat.count==UserInfoPage.currentPage}">
                          <option selected="selected" value="${stat.count}">${stat.count}</option>
                        </c:when>
                        <c:otherwise>
                          <option value="${stat.count}">${stat.count}</option>
                        </c:otherwise>
                      </c:choose>
                    </c:forEach>
                  </select>页
                </td>
              </tr>
            </table>
          </form>
          <%-- 有数据从Action传来 结束--%>
        </c:when>
        <c:otherwise>
          <c:choose>
            <c:when test="${not empty requestScope.FromSearchUserInfoAction}">
              <%-- 如果是从Ation那里转来的 但没有数据 --%>
              <table width="90%" height=168 align="center">
                <tr>
                  <td align="center" height=168>
                    <font size="5" color="#ff0000">无可供参考的数据</font>
                  </td>
                </tr>
              </table>
            </c:when>
            <c:otherwise>
              <%-- 如果是正确的第一次访问--%>
             <jsp:forward page="searchUserInfo.do" />
            </c:otherwise>
          </c:choose>
        </c:otherwise>
      </c:choose>
<%-- ------------------------------------------------------------ --%>

⌨️ 快捷键说明

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