Spring as MVC Framework



Spring provides a web framework based on the MVC paradigm (Model-View-Controller). Eventhough it is similar in many ways to other popular MVC frameworks such as Webwork and Struts, I believe that Spring Web MVC provides more important advantages over those frameworks. Spring MVC provides implementations of workflow typical to web applications. It is highly flexible, allowing the user to use a many 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. After studying some of the most important infrastructural components, I will continue to show you a couple of practical scenarios in which I use most of the components explained earlier. After reading this article you will have the basic knowledge of workflow in a Spring-based web application. You will be able to implement your own controllers handling common tasks such as form validation, data binding, submissions, and uploading files. You will also have an overall insight into all of Spring's web-related functionality, including the way Spring MVC enforces most usefull practices when using JavaServer Pages and how it can be used along with appropriate third-party libraries to generate Excel spreadsheets, PDF documents, and other content types.