O'Reilly logo

Professional Java™ Development with the Spring Framework by Colin Sampaleanu, Thomas Risberg, Alef Arendsen, Juergen Hoeller, Rod Johnson

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

Chapter 12. Web MVC Framework

Spring provides a web framework based on the Model-View-Controller (MVC) paradigm. Although it is similar in some ways to other popular MVC frameworks such as Struts and WebWork, we believe that Spring Web MVC provides significant advantages over those frameworks. Spring MVC provides out-of-the-box implementations of workflow typical to web applications. It is highly flexible, allowing you to use a variety of different view technologies. It also enables you to fully integrate with your Spring-based, middle-tier logic through the use of the Dependency Injection features you've already seen.

You can use Spring Web MVC to make services created with other parts of Spring available to your users by implementing web interfaces. This chapter gives you an overview of the architecture of Spring's Web MVC framework as well as the implementation of concepts such as model, view, and controller. After studying some of the most important infrastructural components, we'll continue to guide you through a couple of practical scenarios in which we'll use most of the components explained earlier.

After reading this chapter you will have learned the basics about workflow in a Spring-based web application. You'll be able to implement your own controllers handling common tasks such as form submissions, validation, data binding, and uploading files. You will also have an overall insight into all of Spring's web-related functionality, including the way Spring MVC enforces best ...

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