Exception of Binding form data to object
Posted
by Captain Kidd
on Stack Overflow
See other posts from Stack Overflow
or by Captain Kidd
Published on 2010-05-25T02:47:03Z
Indexed on
2010/05/25
2:51 UTC
Read the original article
Hit count: 263
spring-mvc
I'm practising Spring MVC.But fail to populate command object in Controller when I use spring standard tag. For example: "form:input path="password""
But I perfectly do this with HTML standard tag. Like: "input type="text" name="password""
I wonder the way how to use Spring tag binding data. In addition, I think configuration and coding is right in my sample.
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,
Object command, BindException errors) throws Exception {
UserFormBean b = (UserFormBean)command;
System.out.println("s");
return super.onSubmit(request, response, command, errors);
}
<form:form commandName="command" action="/SpringFrame/register.html">
<form:input path="password"/>
<!-- <input type="text" name="password"/> -->
<input type="submit"/>
</form:form>
© Stack Overflow or respective owner