Apress.Beginning.Spring.Boot.2.pdf

所需积分/C币:10 2017-11-13 18:03:53 4.65MB PDF
收藏 收藏
举报

Apress.Beginning.Spring.Boot.2.pdfApress.Beginning.Spring.Boot.2.pdfApress.Beginning.Spring.Boot.2.pdfApress.Beginning.Spring.Boot.2.pdfApress.Beginning.Spring.Boot.2.pdf
Beginning Spring Boot 2: Applications and Microservices with the Spring framework K Siva Prasad reddy Hyderabad, India ISBN-13(pbk):978-1-4842-2930-9 ISBN-13(electronic): 978-1-4842-2931-6 DOI10.1007/978-1-4842-2931-6 Library of Congress Control Number: 2017955551 Copyright o 2017 by K Siva Prasad Reddy This work is subject to copyright All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein CoverimagebyFreepik(www.freepik.com) Managing director: Welmoed spahr Editorial Director: Todd green Acquisitions Editor Steve Anglin Development Editor: Matthew Moodie Technical reviewer: Massimo nardone Coordinating Editor: Mark Powers Copy Editor: Kezia Endsley Distributed to the book trade worldwide by Springer Science+ Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax(201)348-4505, e-mail orders-ny@springer-sbm.comorvisitwww.springeronline.comApressMedia,LlcisaCaliforniaLlc and the sole member (owner )is Springer Science+ Business Media Finance Inc(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation Forinformationontranslationspleasee-mailrights@apress.comorvisithttp://www.apress.com/ rights-permissions. Apress titles may be purchased in bulk for academic, corporate, or promotional use e Book versions and licenses are also available for most titles For more information reference our print and ebook bulk sales webpageathttp://www.apress.com/bulk-sales Any source code or other supplementary material referenced by the author in this book is available to readersonGithubviathebooksproductpagelocatedatwww.apress.com/9781484229309.Formore detailedinformationpleasevisithttp://www.aprEss.com/source-code Printed on acid-free paper Contents at a glance About the author… About the technical reviewer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Acknowledgments ■■■■■■ Introduction Chapter1: Introduction to Spring B00t,…,…, ■■■■■■ Chapter 2: Getting Started with Spring boot mm ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■■■■■■■■■■ 21 Chapter 3: Spring Boot Autoconfiguration aa 35 Chapter 4: Spring Boot Essentials mmaaaamanm 47 Chapter5: Working with JdbcTemplate…,……,,,,,…55 Chapter 6: Working with My Batis a65 Chapter 7: Working with J00Q ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Chapter 8: Working with JPA. mammmnamaaanmmmmamamanmmam 83 Chapter 9: Working with MongoDB ammmmmmmmamammammmmmmmmanm 99 Chapter 10: Web Applications with Spring Boot. 107 Chapter 11: Building REST APls Using Spring Boot 133 Chapter12: Reactive Programming Using Spring WebFlux,,,,,,………157 Chapter 13: Securing Web Applications 175 Chapter 14: Spring Boot Actuator ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 197 Chapter 15: Testing Spring Boot Applications 221 CONTENTS ATA GLANCE Chapter 16: creating a Custom Spring boot Starter 247 Chapter 17: Spring Boot with Groovy, Scala, and Kotlin mma 259 Chapter 18: Introducing JHipster 279 Chapter 19: Deploying Spring Boot Applications. 289 Index 301 Contents About the author… About the technical reviewer ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Acknowledgments ■■■■■■ Introduction Chapter 1: Introduction to Spring Boot. Overview of the Spring framework Spring Configuration Styles 1123 Developing Web application Using SpringlVC and JPA A Quick Taste of spring boot …16 Easy Dependency Management……,, 19 Autoconfiguration ...........................................................................................19 Embedded Servlet Container Support....... 19 Summary… nnnnnnnnnnnnnnnnnnnnnnnnnnD 20 Chapter 2: Getting Started with Spring Boot ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■ 21 What ls spring boot? 21 Spring boot starters 21 Spring boot autoconfiguration.....,,,,,…,,,…,…,,,… Elegant Configuration Management Spring Boot Actuator...,,,,,,…,… 2222 Easy-to-Use Embedded Servlet Container Support CONteNtS Your First Spring Boot application…… 23 Using Spring Initialize….......……23 sing the Spring Tool Suite.. 24 sing Intellij IDEA....... 25 Using netBeans iDE 26 Exploring the Project 26 The application Entry Point class......,…,…31 Fat JAR Using the Spring boot Maven Plugin 32 Spring Boot Using Gradle 32 Maven or gradle?…3 Summary 33 Chapter 3: Spring Boot Autoconfiguration n35 Exploring the Power of @Conditional 35 sing @ Conditional Based on System Properties 36 Using @Conditional Based on the Presence/Absence of a Java class 38 Jsing @Conditional Based on the Configured Spring Beans Using @Conditional Based on a Property's configuration Spring Boot's Built-h@ Conditional annotations……… 40 How Spring Boot Autoconfiguration Works 42 Summary as 45 Chapter 4: Spring Boot Essentials amaama 47 oggIng…… 47 EXternalizing Configuration Properties 49 Type-Safe Configuration Properties. Relaxed Binding . Validating Properties with the Bean Validation APl.......................50 Developer Tools 51 Summary 53 CONTENTS Chapter 5: Working with JdbcTemplate ■■■■■■ 55 Using Jdbc Template Without SpringBoot 55 Using JdbcTemplate with Spring Boot 58 Initializing the Database.. 58 Using other Connection Pooling Libraries 62 atabase migration with flyway.ccee.e 63 Summary..tenne 64 Chapter 6: Working with MyBatis ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■口■■ 65 Using the Spring B00 t My Batis Starter.....,.…………………65 Summary Chapter 7: Working with J00Q Introduction to J00Q Using Spring Boot's JooQ Starter 72 Configure Spring Boot JooQ star Database schema Code generation Using the JooQ Maven Codegen Plugin 74 Add jooQ generated code as a source folder......mo.m...... 76 Domain objects…...………………77 Using J00Q DSL Summary nnnnnnnnnnnnnnnnnnnnnnnnD 82 Chapter 8: Working with JPA. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 83 Introducing the Spring Data JPA Using Spring Data JPA with Spring boot. Add Dynamic Query Methods 88 Using the Sort and Pagination Features Working with Multiple Databases Use OpenEntity ManagerInview Filter for Multiple Data Sources 96 Summary D 97 CONTENTS Chapter 9: Working with MongoDB g99 Introducing MongoDB 99 Installing MongoDB 100 stalling MongoDB on Windows....,.,,,……,100 Installing MongoDB on MacOS ,101 Installing mongodb on linux 101 Getting Started with MongoDB Using the Mongo Shell 101 Introducing Spring Data MongoDB 102 Using Embedded Mongo for Testing ,105 Summary 106 Chapter 10: Web Applications with Spring boot.ar ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 107 Introducing Spring/VC.amaeaeaannaneaemmnmnnanonann 107 Developing Web application Using spring bo0t………… 109 Using the Tomcat, Jetty, and Undertow Embedded servlet Containers 112 Customizing Embedded Servlet Containers…...,.,……,114 Customizing SpringMVC Configuration..……………115 Registering Servlets, Filters, and listeners as Spring beans... 116 Spring boot Web application as a Deployable WAR 119 View Templates that Spring Boot Supports.. 120 Using the Thymeleaf view Templates 121 Working with Thymeleaf Forms..ae.e..... 122 Form validation File Uploading… ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■D■D■D■D■D■DD■■■■■ 128 Using Resource Bundles for Internationalization(18n) 128 Resource Bundles for hibernate validation errors 129 Error handling∴ 130 S umma 132 CONTENTS Chapter 11: Building REST APls Using Spring Boot maman 133 Introduction to restful Web services 133 REST API Using SpringMVC 134 CORS ( Cross-Origin Resource Sharing) Support 144 Exposing JPA Entities with Bi-Directional References Through RESTful Services 146 REST API Using Spring Data REST. Sorting and Pagination…,… CORS Support in Spring Data REST.........153 Exception Handling…153 Summary......e... 155 Chapter 12: Reactive Programming Using Spring WebFlux a157 Introduction to Reactive Programming 157 Reactive streams 158 Project reactor...................158 Reactive Web Applications Using Spring WebF|uX……......,……,159 bFlux Using the Annotation-Based Programming Model 160 WebFlux Using a Functional Programming model 163 Thymeleaf Reactive Support...,.,,.,,,,,,…,……169 Reactive Webclient…172 Testing Spring Web Flux applications Summary ,174 Chapter 13: Securing Web applications n 5 Spring Security in Spring Boot Web application 175 Implementing the Remember-Me Feature 184 Simple Hash-Based Token as Cookie. Persistent Tokens 186 Cross-Site Request Forgery ……….187 Method-Level Security nnnnnnnnnnnnnnnnnnnnnnnD 188 Securing the REST API Using Spring Security …190 Summary..................195

...展开详情
试读 127P Apress.Beginning.Spring.Boot.2.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
抢沙发
一个资源只可评论一次,评论内容不能少于5个字
  • 分享宗师

    成功上传21个资源即可获取
关注 私信 TA的资源
上传资源赚积分,得勋章
最新推荐
Apress.Beginning.Spring.Boot.2.pdf 10积分/C币 立即下载
1/127
Apress.Beginning.Spring.Boot.2.pdf第1页
Apress.Beginning.Spring.Boot.2.pdf第2页
Apress.Beginning.Spring.Boot.2.pdf第3页
Apress.Beginning.Spring.Boot.2.pdf第4页
Apress.Beginning.Spring.Boot.2.pdf第5页
Apress.Beginning.Spring.Boot.2.pdf第6页
Apress.Beginning.Spring.Boot.2.pdf第7页
Apress.Beginning.Spring.Boot.2.pdf第8页
Apress.Beginning.Spring.Boot.2.pdf第9页
Apress.Beginning.Spring.Boot.2.pdf第10页
Apress.Beginning.Spring.Boot.2.pdf第11页
Apress.Beginning.Spring.Boot.2.pdf第12页
Apress.Beginning.Spring.Boot.2.pdf第13页
Apress.Beginning.Spring.Boot.2.pdf第14页
Apress.Beginning.Spring.Boot.2.pdf第15页
Apress.Beginning.Spring.Boot.2.pdf第16页
Apress.Beginning.Spring.Boot.2.pdf第17页
Apress.Beginning.Spring.Boot.2.pdf第18页
Apress.Beginning.Spring.Boot.2.pdf第19页
Apress.Beginning.Spring.Boot.2.pdf第20页

试读结束, 可继续阅读

10积分/C币 立即下载 >