万本电子书0元读

万本电子书0元读

顶部广告

Mastering Spring MVC 4电子书

售       价:¥

44人正在读 | 0人评论 9.8

作       者:Geoffroy Warin

出  版  社:Packt Publishing

出版时间:2015-09-14

字       数:112.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Gain expertise in designing real-world web applications using the Spring MVC framework About This Book Design your own Spring web applications using tools such as Spring Boot and Spring Tool Suite Secure your developments with easy-to-write, reliable unit and end-to-end tests Deploy your application on the cloud for free and invite the whole world to see Who This Book Is For This book is perfect for developers who are familiar with the fundamentals of Spring programming and are eager to deepen their web development skills. Prior knowledge of the Spring MVC framework is recommended. What You Will Learn Set up your own web application using Spring Boot and Spring Tool Suite Discover the MVC architecture and the different tools along with navigating between views Design complex advanced-level forms and validate the model Craft a RESTful application with a meaningful API and error messages Create maintainable unit and acceptance tests Secure your application while allowing it to scale Optimize your requests with caching, ETags, and asynchronous responses Deploy the web application to the cloud in a snap In Detail Spring MVC is the ideal tool to build modern web applications on the server side. With the arrival of Spring Boot, developers can really focus on the code and deliver great value, leveraging the rich Spring ecosystem with minimal configuration. Spring makes it simple to create RESTful applications, interact with social services, communicate with modern databases, secure your system, and make your code modular and easy to test. It is also easy to deploy the result on different cloud providers. Mastering Spring MVC will take you on a journey from developing your own web application to uploading it on the cloud. You begin by generating your own Spring project using Spring Tool suite and Spring Boot. As you develop an advanced-level interactive application that can handle file uploads as well as complex URLs, you will dive into the inner workings of Spring MVC and the principles of modern web architectures. You will then test, secure, and optimize your Spring web application and design RESTful services that will be consumed on the frontend. Finally, when everything is ready, you will release your application on a cloud provider and invite everyone to see. Style and approach An iterative hands-on approach in a conversational and easy-to-follow style. Each chapter will improve on the work done in the previous one until the application is ready to be released.
目录展开

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

累计评论(0条) 1个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部