O'Reilly logo

Spring: Developing Java Applications for the Enterprise by Ravi Kant Soni, Rajesh RV, Amuthan Ganeshan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Serving and processing forms

In the previous chapters, you learned how to retrieve data from an in-memory database using the Controller, but you didn't learn how to store the data in an in-memory database from the View. In Spring MVC, the process of putting an HTML form element's values into model data is called form binding.

In all the previous chapter's examples, you saw that the data transfer took place from the Model to the View via the Controller. The following line is a typical example of how we put data into the Model from the Controller:

model.addAttribute(greeting,"Welcome") 

Similarly, the next line shows how we retrieve that data in the View using a JSTL expression:

<p> ${greeting} </p> 

But what if we want to put data into the Model from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required