list.jsp

来自「大家好啊 快来抢购J2ME东东 挺不错的啊 不要后悔啊 抓住机会」· JSP 代码 · 共 61 行

JSP
61
字号
<%@ page language="java" contentType="text/html" %>
<%@ page import="com.ora.jsp.util.*" %>
<%@ taglib uri="/orataglib" prefix="ora" %>
<html>
  <head>
    <title>Search Result</title>
  </head>
  <body bgcolor="white">

    <jsp:useBean id="empList" scope="request" class="java.util.Vector" />

    <% if (empList.size() == 0) { %>
      Sorry, no employees were found.
    <% } else { %>
      The following employees were found:
      <p>
      <table border=1>
        <th>Last Name</th>
        <th>First Name</th>
        <th>Department</th>
        <th>Email Address</th>
        <th>Modified</th>
        <th>User Name</th>
        <th>Password</th>
        <ora:loop name="empList" loopId="row" className="com.ora.jsp.sql.Row" >
          <tr>
            <td><%= row.getString("LastName") %></td>
            <td><%= row.getString("FirstName") %></td>
            <td><%= row.getString("Dept") %></td>
            <td><%= row.getString("EmailAddr") %></td>
            <td><%= row.getString("ModDate") %></td>
            <% if (request.isUserInRole("admin") ||
              row.getString("UserName").equals(request.getRemoteUser())) { %>
              <td><%= row.getString("UserName") %></td>
              <td><%= row.getString("Password") %></td>
            <% } else { %>
              <td>**</td>
              <td>**</td>
            <% } %>
            <% if (request.isUserInRole("admin")) { %>
              <td>
                <form action="delete.jsp" method="post">
                  <input type="hidden" name="userName"
                    value='<%= StringFormat.toHTMLString(row.getString("UserName")) %>'>
                  <input type="hidden" name="firstName"
                    value='<%= StringFormat.toHTMLString(request.getParameter("firstName")) %>'>
                  <input type="hidden" name="lastName"
                    value='<%= StringFormat.toHTMLString(request.getParameter("lastName")) %>'>
                  <input type="hidden" name="dept"
                    value='<%= StringFormat.toHTMLString(request.getParameter("dept")) %>'>
                  <input type="submit" value="Delete">
                </form>
              </td>
            <% } %>
          </tr>
        </ora:loop>
      </table>
    <% } %>
  </body>
</html>

⌨️ 快捷键说明

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