spring spring框架中的命令对象是什么
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7583577/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is the command object in spring framework
提问by Ravichandra
Could you please explain about command object in spring frame work with an example?
你能用一个例子解释一下弹簧框架中的命令对象吗?
采纳答案by tolitius
from Spring Documentation:
来自 Spring 文档:
Command Object- a JavaBean which will be populated with the data from your forms
Command Object- 一个 JavaBean,它将填充表单中的数据
Think of Command Objectas a POJO/JavaBean/etc.. that backs the form in your presentation layer.
将其Command Object视为支持表示层中的表单的 POJO/JavaBean/等。
Once the form is submitted, all the individual attributes are mapped/bound to this object. On the way up to presentation, Command Objectproperties may be used to pre/populate the form.
提交表单后,所有单独的属性都映射/绑定到此对象。在进行演示的过程中,Command Object可以使用属性来预/填充表单。
check an example here
在此处查看示例

