售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Spring Essentials
Table of Contents
Spring Essentials
Credits
About the Authors
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
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Spring Core
The Spring landscape
The Spring Framework modules
Spring Tool Suite (STS)
Spring subprojects
Design concepts behind Spring Framework
Setting up the development environment
Your first Spring application
Inversion of Control explained
Dependency Injection
The Spring IoC container
Configuration metadata
XML-based configuration metadata
Annotation-based configuration metadata
XML-based versus annotation-based configuration
Component stereotype annotations
Java-based configuration metadata
JSR 330 standard annotations
Beans in detail
Bean definition
Instantiating beans
With constructors
With a static factory-method
With an instance factory-method
Injecting bean dependencies
Constructor-based Dependency Injection
Setter-based Dependency Injection
Constructor-based or setter-based DI – which is better?
Cleaner bean definitions with namespace shortcuts
Wiring a List as a dependency
Wiring a Map as a dependency
Autowiring dependencies
Bean scoping
Dependency Injection with scoped beans
Creating a custom scope
Hooking to bean life cycles
Implementing InitializingBean and DisposableBean
Annotating @PostConstruct and @PreDestroy on @Components
The init-method and destroy-method attributes of <bean/>
Container-level default-init-method and default-destroy-method
Working with bean definition profiles
Injecting properties into the Spring environment
Externalizing properties with PropertyPlaceholderConfigurer
Handling resources
Spring Expression Language
SpEL features
SpEL annotation support
The SpEL API
Aspect Oriented Programming
Static and dynamic AOP
AOP concepts and terminology
Spring AOP – definition and configuration styles
XML schema-based AOP
@AspectJ annotation-based AOP
Declaring an @Aspect annotation
Pointcuts
Pointcut designators
Pointcut examples
Advices
The @Around Advice
Accessing Advice parameters
Testing with Spring
Mock objects
Unit and integration testing utilities
Summary
2. Building the Web Layer with Spring Web MVC
Features of Spring MVC
The Model-View-Controller pattern
Your first Spring MVC application
Setting up a Spring MVC application
The project structure of a Spring MVC application
The web.xml file – Springifying the web app
ApplicationContext files in a Spring MVC application
HomeController – @Controller for the home screen
The home.jsp file – the landing screen
Handling incoming requests
The architecture and components of Spring MVC
DispatcherServlet explained
WebApplicationContext – ApplicationContext for the Web
Beans supporting DispatcherServlet and their roles
Controllers in detail
Mapping request URLs with @RequestMapping
URI template patterns with the @PathVariable annotation
Binding parameters with the @RequestParam annotation
Request handler method arguments
Request handler method return types
Setting Model attributes
Building RESTful services for JSON and XML media
Building a RESTful service with RestController
Asynchronous request processing in Spring MVC
Working with views
Resolving views
Resolving JSP views
Binding Model attributes in JSP pages using JSTL
Spring and Spring form tag libraries
Composing a form in JSP
Validating forms
Handling file uploads
Resolving Thymeleaf views
More view technologies
Summary
3. Accessing Data with Spring
Configuring DataSource
Using embedded databases
Handling exceptions in the Spring Data layer
DAO support and @Repository annotation
Spring JDBC abstraction
JdbcTemplate
NamedParameterJdbcTemplate
SimpleJdbc classes
JDBC operations with Sql* classes
Spring Data
Spring Data Commons
Spring Data repository specification
Spring Data JPA
Enabling Spring Data JPA
JpaRepository
Spring Data MongoDB
Enabling Spring Data MongoDB
MongoRepository
Domain objects and entities
Query resolution methods
Using the @Query annotation
Spring Data web support extensions
Auditing with Spring Data
Spring Transaction support
Relevance of Spring Transaction
Spring Transaction fundamentals
Declarative transaction management
Transactional modes – proxy and AspectJ
Defining transactional behavior
Setting rollback rules
Using the @Transactional annotation
Enabling transaction management for @Transactional
Programmatic transaction management
Summary
4. Understanding WebSocket
Creating a simple WebSocket application
STOMP over WebSocket and the fallback option in Spring 4
Broadcasting a message to a single user in a WebSocket application
Summary
5. Securing Your Applications
Authentication
Authorization
The OAuth2 Authorization Framework
Summary
6. Building a Single-Page Spring Application
The motivations behind SPAs
SPAs explained
The architectural benefits of SPAs
SPA frameworks
Introducing Ember.js
The anatomy of an Ember application
Routers
Routes or route handlers
Templates
Components
Models
Controllers
Input helpers
Custom helpers
Initializers
Services
Working with Ember CLI
Setting up Ember CLI
Getting started with Ember CLI commands
The Ember project structure
Working with the POD structure
Understanding the Ember object model
Declaring types (classes) and instances
Accessing and mutating properties
Computed properties
Property observers
Working with collections
Building UI templates using Handlebars
Handlebars helpers
Data binding with input helpers
Using control flow helpers in Handlebars
Using event helpers
Handling routes
Handling UI behavior using components
Building a ToggleButton component step by step
Persisting data with Ember Data
Ember Data architecture
Defining models
Defining model relationships
Building a Taskify application
Building the API server app
Setting up and configuring the project
Defining the model definitions – User and Task
Building API endpoints for the Taskify app
UserController.java
TaskController.java
Building the Taskify Ember app
Setting up Taskify as an Ember CLI project
Setting up Ember Data
Configuring application routes
Building the home screen
Building the user screen
Building a custom helper
Adding action handlers
Building a custom component – modal window
Building userEditModal using {{modal-window}}
Building the task screen
Summary
7. Integrating with Other Web Frameworks
Spring's JSF integration
Spring's Struts integration
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜