售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Spring MVC Beginner's Guide - Second Edition
Spring MVC Beginner's Guide - Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Time for action
What just happened?
Pop quiz
Have a go hero
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Configuring a Spring Development Environment
Setting up Java
Time for action - installing JDK
Time for action - setting up environment variables
Configuring a build tool
Time for action - installing the Maven build tool
Installing a web server
Time for action - installing the Tomcat web server
Configuring a development environment
Time for action - installing Spring Tool Suite
Time for action - configuring Maven on STS
Time for action - configuring Tomcat on STS
Creating our first Spring MVC project
Time for action - creating a Spring MVC project in STS
Time for action - adding Java version properties in pom.xml
What just happened?
Spring MVC dependencies
Time for action - adding Spring jars to the project
What just happened?
A jump-start to MVC
Time for action - adding a welcome page
What just happened?
The Dispatcher servlet
Time for action - configuring the Dispatcher servlet
What just happened?
Deploying our project
Time for action - running the project
Summary
2. Spring MVC Architecture – Architecting Your Web Store
Dispatcher servlet
Time for action - examining request mapping
What just happened?
Pop quiz – request mapping
Understanding the Dispatcher servlet configuration
Time for action - examining the servlet mapping
What just happened?
Servlet mapping versus request mapping
Pop quiz - servlet mapping
Web application context
View resolvers
Time for action - understanding web application context
What just happened?
Understanding the web application context configuration
Pop quiz - web application context configuration
Model View Controller
Overview of the Spring MVC request flow
The web application architecture
The Domain layer
Time for action - creating a domain object
What just happened?
The Persistence layer
Time for action - creating a repository object
What just happened?
The Service layer
Time for action - creating a service object
What just happened?
Have a go hero - accessing the product domain object via a service
An overview of the web application architecture
Have a go hero - listing all our customers
Summary
3. Control Your Store with Controllers
The role of a Controller in Spring MVC
Defining a Controller
Time for action - adding class-level request mapping
What just happened?
Default request mapping method
Pop quiz - class level request mapping
Handler mapping
Using URI template patterns
Time for action - showing products based on category
What just happened?
Pop quiz - request path variable
Using matrix variables
Time for action - showing products based on filters
What just happened?
Understanding request parameters
Time for action - adding a product detail page
What just happened?
Pop quiz - the request parameter
Time for action - implementing a master detail View
What just happened?
Have a go hero - adding multiple filters to list products
Summary
4. Working with Spring Tag Libraries
The JavaServer Pages Standard Tag Library
Serving and processing forms
Time for action - serving and processing forms
What just happened?
Have a go hero - customer registration form
Customizing data binding
Time for action - whitelisting form fields for binding
What just happened?
Pop quiz - data binding
Externalizing text messages
Time for action - externalizing messages
What just happened?
Have a go hero - externalizing all the labels from all the pages
Summary
5. Working with View Resolver
Resolving Views
RedirectView
Time for action - examining RedirectView
What just happened?
Pop quiz - RedirectView
Flash attribute
Serving static resources
Time for action - serving static resources
What just happened?
Pop quiz - static view
Time for action - adding images to the product detail page
What just happened?
Multipart requests in action
Time for action - adding images to a product
What just happened?
Have a go hero - uploading product user manuals to the server
Using ContentNegotiatingViewResolver
Time for action - configuring ContentNegotiatingViewResolver
What just happened?
Working with HandlerExceptionResolver
Time for action - adding a ResponseStatus exception
What just happened?
Time for action - adding an exception handler
What just happened?
Summary
6. Internalize Your Store with Interceptor
Working with interceptors
Time for action - configuring an interceptor
What just happened?
Pop quiz - interceptors
LocaleChangeInterceptor - internationalization
Time for action - adding internationalization
What just happened?
Have a go hero - fully internationalize the product details page
Mapped interceptors
Time for action - mapped intercepting offer page requests
What just happened?
Summary
7. Incorporating Spring Security
Using Spring Security
Time for action - authenticating users based on roles
What just happened?
Pop quiz - Spring Security
Have a go hero - play with Spring Security
Summary
8. Validate Your Products with a Validator
Bean Validation
Time for action - adding Bean Validation support
What just happened?
Have a go hero - adding more validation in the Add new product page
Custom validation with JSR-303/Bean Validation
Time for action - adding Bean Validation support
What just happened?
Have a go hero - adding custom validation to a category
Spring validation
Time for action - adding Spring validation
What just happened?
Time for action - combining Spring validation and Bean Validation
What just happened?
Have a go hero - adding Spring validation to a product image
Summary
9. Give REST to Your Application with Ajax
Introduction to REST
Time for action - implementing RESTful web services
What just happened?
Time for action - consuming REST web services
What just happened?
Handling web services in Ajax
Time for action - consuming REST web services via Ajax
What just happened?
Summary
10. Float Your Application with Web Flow
Working with Spring Web Flow
Time for action - implementing the order processing service
What just happened?
Time for action - implementing the checkout flow
What just happened?
Understanding flow definitions
Understanding checkout flow
Pop quiz - web flow
Time for action - creating Views for every view state
What just happened?
Have a go hero - adding a decision state
Summary
11. Template with Tiles
Enhancing reusability through Apache Tiles
Time for action - creating Views for every View state
What just happened?
Pop quiz - Apache Tiles
Summary
12. Testing Your Application
Unit testing
Time for action - unit testing domain objects
What just happened?
Have a go hero - adding tests for Cart
Integration testing with the Spring Test context framework
Time for action - testing product validator
What just happened?
Time for action - testing product Controllers
What just happened?
Time for action - testing REST Controllers
What just happened?
Have a go hero - adding tests for the remaining REST methods
Summary
Thank you readers!
Appendix A. Using the Gradle Build Tool
Installing Gradle
The Gradle build script for your project
Understanding the Gradle script
Appendix B. Pop Quiz Answers
Chapter 2, Spring MVC Architecture - Architecting Your Web Store
Chapter 3, Control Your Store with Controllers
Chapter 4, Working with Spring Tag Libraries
Chapter 5, Working with View Resolver
Chapter 6, Internalize Your Store with Interceptor
Chapter 7, Incorporating Spring Security
Chapter 10, Float Your Application with Web Flow
Chapter 11, Template with Tiles
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜