O'Reilly logo

Spring MVC Beginner’s Guide by Amuthan G

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

The persistence layer

Since we had a single product, we just instantiated it in the controller itself and displayed this product information on our web page successfully. However, a typical webstore contains thousands of products; all the information for these products is usually stored in a database. So, we need to make our ProductController class smart enough to load all the product information from the database into the model. However, if we write all the data retrieval logic in the ProductController class itself to retrieve product information from the database, our ProductController class will blow down into a big chunk of file. Logically speaking, data retrieval is not the duty of the controller because the controller is a presentation layer ...

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