Chapter 5. Advanced Spring MVC
The previous chapter covered the basics of Spring MVC. Now you are ready to take Spring MVC one step further and dive into some of the more advanced capabilities that make it such a powerful means of building web applications.
First you'll learn how to submit a form that spans multiple pages. This feature comes in handy when you want to have your users navigate through a couple of pages rather than squeeze the entire form in a single page. While multiple pages are often used for complex forms such as tax declarations or insurance policy applications, in this example you'll use a multipage form to upload pictures to a photo album.
Once you know how to add images to a photo album, you use the MultiActionController
class to group related actions for transforming pictures. Grouping related actions can spare you a lot of typing work as it saves having to code and configure a new controller for each individual action.
After the tour of advanced controllers you go beyond HTML and take a look at different views so that you can download data as a PDF or an Excel spreadsheet. You top this off with a hands-on exercise that teaches you how to set up an RSS news feed. After all, you'd want your friends to come back to the site whenever you upload new pictures.
In this chapter you will learn how to use Spring MVC to do the following:
Submit web forms across multiple pages
Upload files to the server
Process related requests with the same controller
Create PDF and RSS files ...
Get Beginning Spring Framework 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.