<%@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="departmentBean" class="com.jspdev.ch17.DepartmentBean" scope="session"/>
<c:set var="leaders" value="${departmentBean.leaders}"/>
<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/>
<html:form action="createDepartment.do" method="get">
<table align="center" bgcolor="#008800" border="0" cellspacing="2" cellpadding="5">
<tr>
    <td >id:</td>
    <td><html:text property="department.id"/></td>
</tr>
<tr>
    <td >名称:</td>
    <td><html:text property="department.name"/></td>
</tr>
<tr>
    <td>描述:</td>
    <td><html:text property="department.description"/></td>
</tr>
<tr>
    <td>部门管理员:</td>
    <td>
     <html:select name="departmentForm" property="department.leader">
        <html:options collection="leaders" property="id" labelProperty="name"/>
    </html:select>
    </td>
</tr>
</table>
<html:submit><bean:message key="button.submit"/></html:submit>
</html:form> 
</center>
</body>
</html:html>