<%@page contentType="text/html;charset=gb2312"%>
<%@ taglib uri="/struts-logic" prefix="logic" %>
<%@ taglib uri="/struts-bean" prefix="bean" %>
<%@ taglib uri="/struts-html" prefix="html" %>
<%@ taglib uri="/jstl/c" prefix="c" %>
<jsp:useBean id="employeeBean" class="com.jspdev.ch17.EmployeeBean" scope="session"/>
<c:set var="employees" value="${employeeBean.noDeptEmployees}"/>
<html:html locale="true">
<head>
<link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css">
<title>查看所有的员工</title>
</head>
<body>
<center>

<h1>选择可以添加的员工</h1>

<logic:messagesPresent>
    <span id="errorsHeader"><bean:message key="errors.validation.header"/></span>
    <html:messages id="error">
      <li><c:out value="${error}"/></li>
    </html:messages>
    <hr>
</logic:messagesPresent>
 <html:errors/>
   <table align="center" bgcolor="#008800" border="0" cellspacing="2" cellpadding="5">
         <tr bgcolor="#cccccc"> 
         <td><b>ID</b></td> 
         <td><b>姓名 </b></td>  
          <td>添加</td>
         </tr>
       <logic:iterate id="emps" name="employees" >
	  <tr bgcolor="#FFFF88">
	   <html:form action="/addEmployeeToDept.do" method="get">
	  <td>	 
          <bean:write name="emps" property="id" />
          <input type="hidden" name="employId" value='<bean:write name="emps" property="id"/>'>
          <input type="hidden" name="deptId" value='<c:out value="${param.deptId}"/>'>
          </td>
         <td>
          <bean:write name="emps" property="name" /></td>
          <td><input type="submit" value="确定"></td>
        </tr>
         </html:form>
        </logic:iterate>
     </table>
</center>
</body>
</html:html>