Spring 表单绑定的问题
就是配置JSP页面绑定部分代码:
<spring:bind path="command.username">
<td><spring:message code="login.page.username" /></td>
<td><input type="text" name="${status.expression }"
value="${status.value }" /> <font color="red">${status.errorMessage}</font></td>
</spring:bind>
错误信息:Neither BindingResult nor plain target object for bean name 'command' availa!
好像就是上面红包部分的那个command有什么问题?有没人告诉我这个command到底是什么东东?
waiting on line!
[解决办法]
spring tag 没有用过,不过帮你查了下。内容如下:
<spring:bind>的"path"性定了要定的表物件名,名是定在loginController 中的 "commandName"性,名是"command",定"command.*",表示定表物件上所有相的, "status"的"errorMessage"示在Controller中定的息,待在Controller的作中再看到明。
在表中,於"username"位,定了"command.username"性,"status"的"expression"示定的性名,而"value"示表物件中所存的值,的程式在登入失後回到form.jsp,可以在同一面上示息之前入的值。
[解决办法]
那个错误的意思 应该是说: 你的form中没有叫做 command 的对象
[解决办法]
作用域中必须放入一个类似的actionform的实体bean。