Html标签库(Form部分)
1. <html:form>
<html:form action="/regGuest"></html:form>
=>
<form name="regGuestForm" method="post" action="/AddressBook/regGuest.do">
2. <html:text>
<html:text property="name"/>
=>
<input type="text" name="name" value="">
3. <html:cancel>
<html:cancel>俺要立即取消操作!</html:cancel>
=>
<input type="submit" name="org.apache.struts.taglib.html.CANCEL" value="俺要立即取消操作!" onclick="bCancel=true;">
Action的execute中通过isCancel(request)来判断是否为cancel提交
4. <html:reset/>
<html:reset>重新填写</html:reset>
=>
<input type="reset" value="重新填写">
5. <html:submit>
<html:submit>偶要提交表单</html:submit>
=>
<input type="submit" value="偶要提交表单">
6. <html:hidden>
<html:hidden property="name"/><p/>
<html:hidden property="name" value="777"/><p/>
<html:hidden property="name" write="true"/><p/>
=>
<input type="hidden" name="name" value=""><p/>
<input type="hidden" name="name" value="777"><p/>
<input type="hidden" name="name" value=""><p/>
提交后的Html:
<input type="hidden" name="name" value="fds"><p/>
<input type="hidden" name="name" value="777"><p/>
<input type="hidden" name="name" value="fds">fds<p/>
7. <html:checkbox>
<html:checkbox property="programLang"/>
=>
<input type="checkbox" name="programLang" value="on">
<html:checkbox property="programLang" value="true"/>
<%-- 如果用户选择了这个checkbox,则相应的FormBean的programLang的值就为true --%>
=>
<input type="checkbox" name="programLang" value="true">