close
LazyValidatorForm若是從JSP –> Struts,是使用<html:text property="username" size="16" name="lazyForm"/>。那Struts –> JSP又該如何顯示設置呢?
Action Class Code:
Accounts t = this.baseService.findById(new Integer(id)); |
JSP Code:使用<bean:write>
<input type="text" name="USERNAME" id="USERNAME" size="20" value="<bean:write name="lazyForm" property="vo.username" />" /> |
和<html:text>一樣,name屬性是定義在struts_config.xml的form name,其form type就是LazyValidatorForm。而property屬性可以直接用EL,不用弄個${}括起來。其EL表示方式如下:
${lazyForm.map.vo.username} |
全站熱搜