<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/struts-html" prefix="html" %>
<%@ taglib uri="/struts-logic" prefix="logic" %>
<%@ taglib uri="/struts-bean" prefix="bean" %>
<%@ taglib uri="/jstl/c" prefix="c" %>
<jsp:useBean id="departmentBean" class="com.jspdev.ch17.DepartmentBean" scope="session"/>
<c:set var="departments" value="${departmentBean.departments}"/>
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css">
<title><bean:message key="title.employee.employeeform"/></title>
</head>
<body>
<center>
<h1><bean:message key="title.employee.employeeform"/></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="createEmployee.do" focus="employee.name" name="employeeForm" type="com.jspdev.ch17.EmployeeForm">
<table align="center" bgcolor="#008800" border="0" cellspacing="2" cellpadding="5">
<tr>
    <td >id:</td>
    <td><html:text property="employee.id"/></td>
</tr>
<tr>
    <td >Name:</td>
    <td><html:text property="employee.name"/></td>
</tr>
<tr>
    <td>Age:</td>
    <td><html:text property="employee.age"/></td>
</tr>
<tr>
    <td>salary:</td>
    <td><html:text property="employee.salary"/></td>
</tr>
<tr>
    <td>Department:</td>
    <td>
     <html:select name="employeeForm" property="employee.department">
        <html:options collection="departments" property="id" labelProperty="name"/>
    </html:select>
    </td>
</tr>
</table>
<html:submit><bean:message key="button.submit"/></html:submit>
</html:form> 
</center>
</body>
</html:html>