必须导入标签
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>添加员工</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" /> </head> <body> <div id="wrap"> <div id="top_content"> <div id="header"> <div id="rightheader"> <p> 2009/11/20 <br /> </p> </div> <div id="topheader"> <h1 id="title"> <a href="#">main</a> </h1> </div> <div id="navigation"></div> </div> <div id="content"> <p id="whereami"></p> <h1>添加员工信息</h1> <form action="${pageContext.request.contextPath }/em/insert" method="post"> <table cellpadding="0" cellspacing="0" border="0" class="form_table"> <tr> <td valign="middle" align="right">员工名:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="emp.name" /></td> </tr> <tr> <td valign="middle" align="right">工资:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="emp.salary" /></td> </tr> <tr> <td valign="middle" align="right">年龄:</td> <td valign="middle" align="left"><input type="text" class="inputgri" name="emp.age" /></td> </tr> <tr> <td valign="middle" align="right">性别:</td> <td valign="middle" align="left">男 <input type="radio" class="inputgri" name="emp.sex" value="1" /> 女 <input type="radio" class="inputgri" name="emp.sex" value="0" /> </td> </tr> <tr> <td valign="middle" align="right"> 部门: </td> <td valign="middle" align="left"> <select name="departid"><!-- 此处name是提交表单之后的属性--> <c:forEach var="dep" items="${list }"> <option value="${dep.id }">${dep.name }</option><1-- value是传参的值--> </c:forEach> </select></td> </tr> </table> <p> <input type="submit" class="button" value="添加" /> </p> </form> </div> </div> <div id="footer"> <div id="footer_bg">ABC@126.com</div> </div> </div> </body> </html>