关于Spring中form标签

2014-11-24 01:42:28 · 作者: · 浏览: 0

jsp中引入Spring的form标签,需要添加文件头

<%@ taglib prifix="form" uri="http://www.springframework.org/tags/form"%>

First Name:
Last Name:

其中,commandName="user",所以该页的attribute中需要有user属性,并且user属性对应的value值需要是一个与form:form相对应的bean(class),这样才能正确显示该页,就不会报:Neither BindingResult nor plain target object for bean name "user" available as request attribute.的错误了。

本文出自 “TinyKing” 博客