您的位置:首页 > Web前端 > HTML

<html:form ....>为何可以利用上一个文件中的Form给自己自动赋值

2017-03-23 21:05 411 查看
下面是源码:<html:form action="employee.do?method=updateEmployee" onsubmit="return checkEmptyForm(employeeForm)"><table border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="66583D"><tr><th width="75" height="25">编号:</th><td width="200" bgcolor="#FFFFFF"><html:text property="em_serialNumber" readonly="readonly" onclick="alert('此文本框已设为只读,用户不能修改')"/></td><th width="75">姓名:</th><td width="200" bgcolor="#FFFFFF"><html:text property="em_name" title="请输入员工姓名"/></td></tr><html:hidden property="id"/><html:submit>修改</html:submit>   <html:reset>重置</html:reset>   <html:button property="back" value="返回" onclick="javascript:history.go(-1);"> </html:button></html:form>   action=employee对应的Form是EmployeeForm,该<html:form>自动提取文件中EmployeeForm实体类,并利用<html:text>输出相应参数,而不需要手动提取。在转入该JSP文件的上一个文件中,可以利用下面的代码设置EmployeeForm实体类。request.setAttribute("employeeForm", employeeForm);
结果employeeForm直接就被<html:form>引用。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐