Spring Web Flow Set Form Input Value
I am having a problem assigning a default value to my Spring Form input field. Here's my code
<form:form method="post" modelAttribute开发者_如何学Python="employeeDirectoryInfo">
<form:input type="text" value=${employeeInfo.employee_id}>
</form>
The problem is it will say that value attribute is not valid for tag <form:input>
.
Are you just trying to insert that value into the input box, or do you want to bind that property to the box (so that a new value typed by the user gets stored in that property)?
If the former, then just use a regular HTML <input type="text">
and set the value as you are doing.
If the latter, don't use "value", use "path", and leave off the ${}.
精彩评论