没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
266页
Spring Boot aims to simplify Spring development. As such, Spring Boot’s reach stretches to touch everything that Spring touches. It’d be impossible to write a book that covers every single way that Spring Boot can be used, as doing so would involve covering every single technology that Spring itself supports. Instead, Spring Boot in Action aims to distill Spring Boot into four main topics: auto-configuration, starter dependencies, the command-line interface, and the Actuator. Along the way, we’ll touch on a few Spring features as necessary, but the focus will be primarily on Spring Boot.
资源推荐
资源详情
资源评论
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 761
Shelter Island, NY 11964
Email: orders@manning.com
©2016 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books are
printed on paper that is at least 15 percent recycled and processed without the use of elemental
chlorine.
Manning Publications Co. Development editor: Cynthia Kane
20 Baldwin Road Technical development editor: Robert Casazza
PO Box 761 Copyeditor: Andy Carroll
Shelter Island, NY 11964 Proofreader: Corbin Collins
Technical proofreader: John Guthrie
Typesetter: Gordan Salinovic
Cover designer: Marija Tudor
ISBN 9781617292545
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – EBM – 20 19 18 17 16 15
Licensed to Thomas Snead <n.ordickan@gmail.com>
www.allitebooks.com
iii
contents
foreword vii
preface ix
about this book xii
acknowledgments xv
1
Bootstarting Spring 1
1.1 Spring rebooted 2
Taking a fresh look at Spring 2
■
Examining Spring Boot
essentials 4
■
What Spring Boot isn’t 7
1.2 Getting started with Spring Boot 8
Installing the Spring Boot CLI 8
■
Initializing a Spring Boot
project with Spring Initializr 12
1.3 Summary 22
2
Developing your first Spring Boot application 23
2.1 Putting Spring Boot to work 24
Examining a newly initialized Spring Boot project 26
■
Dissecting
a Spring Boot project build 30
2.2 Using starter dependencies 33
Specifying facet-based dependencies 34
■
Overriding starter
transitive dependencies 35
Licensed to Thomas Snead <n.ordickan@gmail.com>
www.allitebooks.com
CONTENTS
iv
2.3 Using automatic configuration 37
Focusing on application functionality 37
■
Running the
application 43
■
What just happened? 45
2.4 Summary 48
3
Customizing configuration 49
3.1 Overriding Spring Boot auto-configuration 50
Securing the application 50
■
Creating a custom security
configuration 51
■
Taking another peek under the covers of
auto-configuration 55
3.2 Externalizing configuration with properties 57
Fine-tuning auto-configuration 58
■
Externally configuring
application beans 64
■
Configuring with profiles 69
3.3 Customizing application error pages 71
3.4 Summary 74
4
Testing with Spring Boot 76
4.1 Integration testing auto-configuration 77
4.2 Testing web applications 79
Mocking Spring MVC 80
■
Testing web security 83
4.3 Testing a running application 86
Starting the server on a random port 87
■
Testing HTML pages
with Selenium 88
4.4 Summary 90
5
Getting Groovy with the Spring Boot CLI 92
5.1 Developing a Spring Boot CLI application 93
Setting up the CLI project 93
■
Eliminating code noise with
Groovy 94
■
What just happened? 98
5.2 Grabbing dependencies 100
Overriding default dependency versions 101
■
Adding dependency
repositories 102
5.3 Running tests with the CLI 102
5.4 Creating a deployable artifact 105
5.5 Summary 106
Licensed to Thomas Snead <n.ordickan@gmail.com>
www.allitebooks.com
剩余265页未读,继续阅读
资源评论
ytzzh0726
- 粉丝: 14
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功