spring mvc标签误区

开发过程中遇到

默认灰色显示部门名称和职位名称,我用的是spring 标签

<form:input path="department" class="text co_gray"
									style="width:83px;" maxlength="10"
									onfocus="if(this.value=='部门名称'){this.value=''};this.style.color='#333'"
									onblur="if(this.value==''){this.value='部门名称';this.style.color='#999';}" value="部门名称"/>

我设置个默认的值 value,当我进入页面时候,

   public String saveBasicInfo(@ModelAttribute("accountUser") AccountUserInput accountUserInput, BindingResult result, ModelMap modelMap) {

 绑定的对象accountUserInput 对象有部门和职位属性,分别对应path name。展示时候 标签中出现两个value,spring标签不会对原来的覆盖。

猜你喜欢

转载自woshixushigang.iteye.com/blog/1336167