Home Page Icon
Home Page
Table of Contents for
Index
Close
Index
by Geoffroy Warin
Mastering Spring MVC 4
Mastering Spring MVC 4
Table of Contents
Mastering Spring MVC 4
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
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
Errata
Piracy
Questions
1. Setting Up a Spring Web Application in No Time
Getting started with Spring Tool Suite
Getting started with IntelliJ
Getting started with start.Spring.io
Getting started with the command line
Let's get started
The Gradle build
Let me see the code!
Spring Boot behind the curtains
The dispatcher and multipart configuration
The view resolver, static resources, and locale configuration
Error and encoding configuration
Embedded Servlet container (Tomcat) configuration
The HTTP port
The SSL configuration
Other configurations
Summary
2. Mastering the MVC Architecture
The MVC architecture
MVC critics and best practices
Anemic Domain Model
Learning from the sources
Spring MVC 1-0-1
Using Thymeleaf
Our first page
Spring MVC architecture
DispatcherServlet
Passing data to the view
Spring Expression Language
Getting data with a request parameter
Enough Hello Worlds, let's fetch tweets!
Registering your application
Setting up Spring Social Twitter
Accessing Twitter
Java 8 streams and lambdas
Material design with WebJars
Using layouts
Navigation
The check point
Summary
3. Handling Forms and Complex URL Mapping
The profile page – a form
Validation
Customize validation messages
Custom annotation for validation
Internationalization
Changing the locale
Translating the application text
A list in a form
Client validation
The check point
Summary
4. File Upload and Error Handling
Uploading a file
Writing an image to the response
Managing upload properties
Displaying the uploaded picture
Handling file upload errors
Translating the error messages
Placing the profile in a session
Custom error pages
URL mapping with matrix variables
Putting it together
The check point
Summary
5. Crafting a RESTful Application
What is REST?
Richardson's maturity model
Level 0 – HTTP
Level 1 – Resources
Level 2 – HTTP verbs
Level 3 – Hypermedia controls
API versioning
Useful HTTP codes
Client is the king
Debugging a RESTful API
A JSON formatting extension
A RESTful client in your browser
httpie
Customizing the JSON output
A user management API
Status codes and exception handling
Status code with ResponseEntity
Status codes with exceptions
Documentation with Swagger
Generating XML
The check point
Summary
6. Securing Your Application
Basic authentication
Authorized users
Authorized URLs
Thymeleaf security tags
The login form
Twitter authentication
Setting up social authentication
Explanation
Distributed sessions
SSL
Generating a self-signed certificate
The easy way
The dual way
Behind a secured server
The check point
Summary
7. Leaving Nothing to Luck – Unit Tests and Acceptance Tests
Why should I test my code?
How should I test my code?
Test-driven development
The unit tests
The right tools for the job
The acceptance tests
Our first unit test
Mocks and stubs
Mocking with Mockito
Stubbing our beans while testing
Should I use mocks or stubs?
Unit testing REST controllers
Testing the authentication
Writing acceptance tests
The Gradle configuration
Our first FluentLenium test
Page Objects with FluentLenium
Making our tests more Groovy
Unit tests with Spock
Integration tests with Geb
Page Objects with Geb
The check point
Summary
8. Optimizing Your Requests
A production profile
Gzipping
Cache control
Application cache
Cache invalidation
Distributed cache
Async methods
ETags
WebSockets
The check point
Summary
9. Deploying Your Web Application to the Cloud
Choosing your host
Cloud Foundry
OpenShift
Heroku
Deploying your web application to Pivotal Web Services
Installing the Cloud Foundry CLI tools
Assembling the application
Activating Redis
Deploying your web application on Heroku
Installing the tools
Setting up the application
Gradle
Procfile
A Heroku profile
Running your application
Activating Redis
Improving your application
Summary
10. Beyond Spring Web
The Spring ecosystem
Core
Execution
Data
Other noteworthy projects
The deployment
Docker
Single Page Applications
The players
The future
Going stateless
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Summary
Index
A
acceptance tests
about /
How should I test my code?
,
The acceptance tests
,
Writing acceptance tests
Gradle, configuration /
The Gradle configuration
with FluentLenium /
Our first FluentLenium test
with Groovy /
Making our tests more Groovy
Anemic Domain Model
URL /
Anemic Domain Model
about /
Anemic Domain Model
API versioning
about /
API versioning
reference link /
API versioning
application cache
creating /
Application cache
reference link /
Application cache
invalidation /
Cache invalidation
distributed cache /
Distributed cache
async methods
using /
Async methods
reference link /
Async methods
authentication
testing /
Testing the authentication
authorized URLs
authenticating /
Authorized URLs
authorized users
authenticating /
Authorized users
B
BackboneJS
about /
The players
basic authentication
URL /
Basic authentication
about /
Basic authentication
configuring /
Basic authentication
for authorized users /
Authorized users
for authorized URLs /
Authorized URLs
thymeleaf security tags, using /
Thymeleaf security tags
C
cache control
about /
Cache control
configuring /
Cache control
check point
about /
The check point
client validation, profile page
enabling /
Client validation
reference link /
Client validation
Cloud Foundry
about /
Cloud Foundry
URL /
Cloud Foundry
Cloud Foundry CLI tools
installing /
Installing the Cloud Foundry CLI tools
URL /
Installing the Cloud Foundry CLI tools
code testing
benefits /
Why should I test my code?
unit tests /
How should I test my code?
acceptance tests /
How should I test my code?
constructor injection
about /
Placing the profile in a session
URL /
Placing the profile in a session
continuous integration
reference link /
Why should I test my code?
Create Read Update Delete (CRUD)
about /
Level 2 – HTTP verbs
Cross Site Request Forgery (CSRF)
about /
Authorized URLs
URL /
Authorized URLs
custom error page
creating /
Custom error pages
D
Data Transfer Object (DTO)
about /
The profile page – a form
deployment
about /
The deployment
Docker /
Docker
Dispatcher Servlet
architecture /
DispatcherServlet
distributed cache
configuring /
Distributed cache
distributed sessions
about /
Distributed sessions
setting up /
Distributed sessions
Docker
about /
Docker
URL /
Docker
reference link /
Docker
documentation
with Swagger /
Documentation with Swagger
Domain Driven Design (DDD)
about /
Anemic Domain Model
E
embedded Servlet container (Tomcat)
configuration /
Embedded Servlet container (Tomcat) configuration
HTTP port, setting /
The HTTP port
SSL configuration /
The SSL configuration
other configurations /
Other configurations
EmbeddedServletContainerCustomizer interface
about /
Handling file upload errors
URL /
Handling file upload errors
Ember
about /
The players
encoding configuration
about /
Error and encoding configuration
error handling
about /
Error and encoding configuration
error messages
translating /
Translating the error messages
ETags
about /
ETags
generating /
ETags
using /
ETags
exception handling
about /
Status codes and exception handling
F
file upload
about /
Uploading a file
profile picture, uploading /
Uploading a file
uploaded images, displaying on web page /
Writing an image to the response
upload properties, managing /
Managing upload properties
uploaded picture, displaying /
Displaying the uploaded picture
errors, handling /
Handling file upload errors
implementation /
Putting it together
check point /
The check point
FluentLenium
used, for acceptance tests /
Our first FluentLenium test
about /
Our first FluentLenium test
URL /
Our first FluentLenium test
Page Objects /
Page Objects with FluentLenium
G
Geb
used, for integration tests /
Integration tests with Geb
about /
Integration tests with Geb
Page Objects /
Page Objects with Geb
reference link /
Page Objects with Geb
Git
URL /
Let's get started
web application, saving /
Let's get started
installing /
Let's get started
about /
Uploading a file
empty directory /
Uploading a file
Gradle
about /
The Gradle build
installing /
The Gradle build
JAR file /
The Gradle build
configuration /
The Gradle configuration
running /
Gradle
URL /
Gradle
Groovy
acceptance tests /
Making our tests more Groovy
about /
Making our tests more Groovy
URL /
Making our tests more Groovy
Groovy Development Kit (GDK)
about /
Making our tests more Groovy
Gzipping
about /
Gzipping
reference link /
Gzipping
H
HandlerMapping
about /
DispatcherServlet
Heroku
about /
Heroku
web application, deploying /
Deploying your web application on Heroku
command-line tools, installing /
Installing the tools
URL /
Installing the tools
web application, setting up /
Setting up the application
Gradle, running /
Gradle
Procfile, running /
Procfile
profile, creating /
A Heroku profile
web application, executing /
Running your application
Redis, activating /
Activating Redis
Heroku Redis add-on
URL /
Activating Redis
host
selecting /
Choosing your host
Cloud Foundry /
Cloud Foundry
OpenShift /
OpenShift
Heroku /
Heroku
HTTP codes
about /
Useful HTTP codes
URL /
Useful HTTP codes
httpie
about /
httpie
HTTP port
setting /
The HTTP port
HTTP sessions
profile, storing /
Placing the profile in a session
about /
Placing the profile in a session
HTTP verbs
GET /
Level 2 – HTTP verbs
HEAD /
Level 2 – HTTP verbs
DELETE /
Level 2 – HTTP verbs
PUT /
Level 2 – HTTP verbs
POST /
Level 2 – HTTP verbs
PATCH /
Level 2 – HTTP verbs
OPTIONS /
Level 2 – HTTP verbs
Hypertext As The Engine Of Application State (HATEOAS)
about /
Level 3 – Hypermedia controls
I
iconmonstr
URL /
Writing an image to the response
integration tests
with Geb /
Integration tests with Geb
IntelliJ
about /
Getting started with IntelliJ
project, creating /
Getting started with IntelliJ
Interceptors
about /
Changing the locale
internationalization (i18n)
about /
Internationalization
locale, modifying /
Changing the locale
application text, translating /
Translating the application text
data list, handling in form /
A list in a form
J
Java 8
streams /
Java 8 streams and lambdas
lambdas /
Java 8 streams and lambdas
Java 8 date time API
reference link /
The profile page – a form
JSON output
customizing /
Customizing the JSON output
JSR-310
URL /
Customizing the JSON output
L
lambdas, Java 8
about /
Java 8 streams and lambdas
layouts
using /
Using layouts
locale configuration
about /
The view resolver, static resources, and locale configuration
login form
designing /
The login form
M
material design
with WebJars /
Material design with WebJars
Materialize
URL /
Material design with WebJars
matrix variables
URL mapping /
URL mapping with matrix variables
Mockito
used, for creating mocks /
Mocking with Mockito
mocks
about /
Mocks and stubs
and stubs, selecting between /
Should I use mocks or stubs?
reference link /
Should I use mocks or stubs?
Multipurpose Internet Mail Extensions (MIME)
about /
Uploading a file
MVC architecture
about /
The MVC architecture
Model /
The MVC architecture
View /
The MVC architecture
Controller /
The MVC architecture
best practice /
MVC critics and best practices
critics /
MVC critics and best practices
Anemic Domain Model /
Anemic Domain Model
sagan project /
Learning from the sources
sagan project, URL /
Learning from the sources
N
navigation
using /
Navigation
Redirect option /
Navigation
Forward option /
Navigation
O
OpenShift
about /
OpenShift
URL /
OpenShift
P
Page Objects
with FluentLenium /
Page Objects with FluentLenium
with Geb /
Page Objects with Geb
PhantomJS
URL /
Our first FluentLenium test
Pivotal Web Services (PWS)
web application, deploying /
Deploying your web application to Pivotal Web Services
Plain Old Java Object (POJO)
about /
The profile page – a form
plain old Java objects (POJOs)
about /
Anemic Domain Model
Procfile
running /
Procfile
production profile
configuring /
A production profile
profile
storing, in session /
Placing the profile in a session
profile page
about /
The profile page – a form
creating /
The profile page – a form
validation, adding /
Validation
client validation, enabling /
Client validation
check point /
The check point
Q
query parameters
about /
Getting data with a request parameter
R
React
about /
The players
Redis
URL /
Distributed sessions
activating /
Activating Redis
,
Activating Redis
REST
about /
What is REST?
REST controllers
unit testing /
Unit testing REST controllers
RESTful API, debugging
about /
Debugging a RESTful API
JSON formatting extension /
A JSON formatting extension
RESTful client, in browser /
A RESTful client in your browser
httpie /
httpie
RESTful web service, properties
client-server /
What is REST?
stateless /
What is REST?
cacheable /
What is REST?
uniform interface /
What is REST?
layered /
What is REST?
Richardson's maturity model
about /
Richardson's maturity model
level 0 - HTTP /
Level 0 – HTTP
level 1 - Resources /
Level 1 – Resources
level 2 HTTP verbs /
Level 2 – HTTP verbs
level 3 Hypermedia controls /
Level 3 – Hypermedia controls
S
SearchApiController class
creating, in search.api package /
Client is the king
security headers
about /
Authorized users
URL /
Authorized users
self-signed certificate
generating /
Generating a self-signed certificate
Single Page Applications
about /
Single Page Applications
recommendations /
The players
future enhancements /
The future
stateless option /
Going stateless
reference link /
Going stateless
Sockjs
about /
WebSockets
Spock
used, for unit tests /
Unit tests with Spock
Spring
ecosystem /
The Spring ecosystem
URL /
The Spring ecosystem
core /
Core
execution /
Execution
XD project, URL /
Execution
data /
Data
noteworthy projects /
Other noteworthy projects
Spring Boot
about /
Spring Boot behind the curtains
initializing /
Spring Boot behind the curtains
configuration /
The dispatcher and multipart configuration
view resolver /
The view resolver, static resources, and locale configuration
static resources /
The view resolver, static resources, and locale configuration
locale configuration /
The view resolver, static resources, and locale configuration
logging in /
The profile page – a form
URL /
The profile page – a form
Spring Data JPA
URL /
Data
Spring Data Mongo
URL /
Data
Spring Data REST
URL /
Data
Spring Expression Language (SpEL)
about /
Spring Expression Language
URL /
Spring Expression Language
data, obtaining with request parameter /
Getting data with a request parameter
Springfox
URL /
Documentation with Swagger
Spring Integration
URL /
Other noteworthy projects
Spring MVC
web application /
Spring MVC architecture
Spring MVC
architecture /
Spring MVC architecture
Spring MVC 1-0-1
about /
Spring MVC 1-0-1
reference link /
Spring MVC 1-0-1
Spring Reactor
URL /
Other noteworthy projects
about /
Other noteworthy projects
Spring Security 4
reference link /
Testing the authentication
Spring Social
about /
Setting up Spring Social Twitter
URL /
Setting up Spring Social Twitter
Spring Social Twitter project
creating /
Enough Hello Worlds, let's fetch tweets!
application, registering /
Registering your application
setting up /
Setting up Spring Social Twitter
Twitter, accessing /
Accessing Twitter
Spring Tool Suite (STS)
about /
Getting started with Spring Tool Suite
URL /
Getting started with Spring Tool Suite
Gradle support, downloading /
Getting started with Spring Tool Suite
Groovy Eclipse plugin, installing /
Getting started with Spring Tool Suite
project, starting /
Getting started with Spring Tool Suite
SSL
configuration /
The SSL configuration
configuration, URL /
The SSL configuration
reference link /
Explanation
,
Behind a secured server
about /
SSL
self-signed certificate, generating /
Generating a self-signed certificate
creating /
The easy way
creating, for http and https channels /
The dual way
creating, behind secured server /
Behind a secured server
start.Spring.io
about /
Getting started with start.Spring.io
URL /
Getting started with start.Spring.io
project, creating /
Getting started with start.Spring.io
command line /
Getting started with the command line
static resources
about /
The view resolver, static resources, and locale configuration
configuration /
The view resolver, static resources, and locale configuration
status code
500 Server Error /
Status codes and exception handling
405 Method not Supported /
Status codes and exception handling
404 Not Found /
Status codes and exception handling
400 Bad Request /
Status codes and exception handling
200 OK /
Status codes and exception handling
with ResponseEntity /
Status code with ResponseEntity
with exception /
Status codes with exceptions
status codes
about /
Status codes and exception handling
streams, Java 8
about /
Java 8 streams and lambdas
stubs
about /
Mocks and stubs
creating, for testing beans /
Stubbing our beans while testing
and mocks, selecting between /
Should I use mocks or stubs?
Swagger
about /
Documentation with Swagger
T
test-driven development (TTD)
about /
Test-driven development
th*each tag
about /
Accessing Twitter
Thymeleaf
about /
Using Thymeleaf
using /
Using Thymeleaf
reference link /
Using Thymeleaf
,
Thymeleaf security tags
page, adding /
Our first page
thymeleaf security tags
using /
Thymeleaf security tags
tools
about /
The right tools for the job
JUnit /
The right tools for the job
AssertJ /
The right tools for the job
Mockito /
The right tools for the job
DbUnit /
The right tools for the job
Spock /
The right tools for the job
Twitter
URL /
Registering your application
,
Twitter authentication
Twitter authentication
setting up /
Twitter authentication
social authentication, setting up /
Setting up social authentication
coding /
Explanation
Typescript
about /
The future
URL /
The future
U
unit tests
about /
How should I test my code?
,
The unit tests
tools /
The right tools for the job
writing /
Our first unit test
REST controllers /
Unit testing REST controllers
with Spock /
Unit tests with Spock
URL mapping
with matrix variables /
URL mapping with matrix variables
user management API
about /
A user management API
V
validation, profile page
adding /
Validation
reference link /
Validation
validation messages, customizing /
Customize validation messages
custom annotation, defining /
Custom annotation for validation
validators
reference link /
Client validation
view resolver
about /
The view resolver, static resources, and locale configuration
configuration /
The view resolver, static resources, and locale configuration
W
war file
URL /
Getting started with Spring Tool Suite
web application
saving, in Git /
Let's get started
Gradle, using /
The Gradle build
code /
Let me see the code!
Dispatcher Servlet /
DispatcherServlet
data, displaying /
Passing data to the view
deploying, to Pivotal Web Services (PWS) /
Deploying your web application to Pivotal Web Services
Cloud Foundry CLI tools, installing /
Installing the Cloud Foundry CLI tools
assembling /
Assembling the application
Redis, activating /
Activating Redis
deploying, on Heroku /
Deploying your web application on Heroku
setting up, on Heroku /
Setting up the application
executing, on Heroku /
Running your application
improving /
Improving your application
WebJars
used, for material design /
Material design with WebJars
layouts, using /
Using layouts
navigation, using /
Navigation
TweetController, using /
The check point
WebSocket
about /
WebSockets
using /
WebSockets
reference link /
WebSockets
X
XML
generating /
Generating XML
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset