Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the command object in spring framework [closed]

Could you please explain about command object in spring frame work with an example?

like image 741
Ravichandra Avatar asked Sep 28 '11 12:09

Ravichandra


People also ask

What is command object in Spring MVC?

Form Backing Object/Command Object This is a POJO that is used to collect all information on a form. It contains data only. It is also called a Command Object in some Spring tutorials. For example, an add a new car form page will have a Car form backing object with attribute data such as Year, Make and Model.

What is command bean?

A command data bean relies on a command to retrieve its data and is a more lightweight data bean. The command retrieves all attributes for the data bean at once, regardless of whether the JSP page requires them.

What is Spring command?

The Spring Boot CLI is a command line tool that you can use if you want to quickly develop a Spring application. It lets you run Groovy scripts, which means that you have a familiar Java-like syntax without so much boilerplate code. You can also bootstrap a new project or write your own command for it.

What is front controller in Spring MVC?

DispatcherServlet is the front controller in Spring Web MVC. Incoming requests for the HTML file are forwarded to the DispatcherServlet.


1 Answers

from Spring Documentation:

  • Command Object - a JavaBean which will be populated with the data from your forms

Think of Command Object as a POJO/JavaBean/etc.. that backs the form in your presentation layer.

Once the form is submitted, all the individual attributes are mapped/bound to this object. On the way up to presentation, Command Object properties may be used to pre/populate the form.

check an example here

like image 99
tolitius Avatar answered Sep 22 '22 01:09

tolitius