What this book covers
Chapter 1, Configuring a Spring Development Environment, will give you a quick overview of Spring MVC and its architecture and guide you through detailed notes and step-by-step instructions to set up your development environment. After installing the required prerequisites, you will try out a quick example of how to develop an application with Spring MVC. Although the chapter doesn't explain all the code in detail, you'll pick up a few things intuitively.
Chapter 2, Spring MVC Architecture – Architecting Your Web Store, will lay down the ground work for the sample application that we are going to build along the way, chapter by chapter. This chapter will introduce you to concepts such as request mapping, web application context, Spring MVC request flow, and the layered architecture of a typical web application.
Chapter 3, Control Your Store with Controllers, will take you through the concept of a controller; you will learn more about how to define a controller, and use URI template patterns, matrix variables, and request parameters.
Chapter 4, Working with Spring Tag Libraries, will teach you how to use Spring and Spring form tag libraries in web form handling. You will learn how to bind domain objects with views and how to use message bundles to externalize label caption texts. At the end of this chapter, you will see how to add a login form.
Chapter 5, Working with View Resolver, will present the inner mechanics of how InternalResourceViewResolver
resolves a view and takes you through how to use various view types, such as redirect view and static view. You will also learn about the multipart resolver and content negotiation view resolver. Finally, you will learn how to use exception handler resolvers.
Chapter 6, Intercept Your Store with Interceptor, will present the concept of an interceptor to you. You will learn how to leverage the interceptor to handle or transform requests and responses flexibly. This chapter will teach you how to make your web page support internalization with the help of LocaleChangeInterceptor
. This chapter also introduces how to perform audit logging in a log file using the interceptor concept.
Chapter 7, Validate Your Products with a Validator, will give you an overview of the validation concept. You will learn about bean validation, and you will learn how to perform custom validation along with the standard bean validation. You will also learn about the classic Spring validation and how to combine it with bean validation.
Chapter 8, Give REST to Your Application with Ajax, will teach you the basic principles of REST and Ajax. You will learn how to develop an application in RESTful services. The basic concept of HTTP verbs and how they are related to standard CRUD operations will be explained, and you will learn how to fire an Ajax request and handle it from a web page.
Chapter 9, Apache Tiles and Spring Web Flow in Action, will teach you how to use the Spring web flow to develop workflow-based web pages. You will learn more about states and transitions in web flow and how to define a flow definition. This chapter also teaches you how to decompose a page using Apache tiles. You will also learn more about TileViewResolver
and how to define reusable Apache tiles templates.
Chapter 10, Testing your Application, will teach you how to leverage the Spring testing capability to test your controllers. You will learn how to load the test context and how to mock the service and repository layers. This chapter also introduces you to the Spring MVC test module and teaches you how to use that.
Appendix A, Using the Gradle Build Tool, introduces you to using the Gradle build tool for our sample application. You will learn about the Gradle script that is required to build our project using Gradle build tool.