chapter 2 sample.pdf - IN ACTION Craig Walls FOREWORD BY...

This preview shows page 1 - 6 out of 30 pages.

Image of page 1
Spring Boot in Action by Craig Walls Chapter 2 Copyright 2016 Manning Publications
Image of page 2
brief content± 1 Bootstarting Spring 2 Developing your first Spring Boot application 23± 3 Customizing configuration 49± 4 Testing with Spring Boot 76± 5 Getting Groovy with the Spring Boot CLI 92± 6 Applying Grails in Spring Boot 107± 7 Taking a peek inside with the Actuator 124± 8 Deploying Spring Boot applications 160± appendix A Spring Boot Developer Tools 181± appendix B Spring Boot starters 188± appendix C Configuration properties 195± appendix D Spring Boot dependencies 232± 1
Image of page 3
Developing your first Spring Boot application This chapter covers Working with Spring Boot starters Automatic Spring configuration When’s the last time you went to a supermarket or major retail store and actually had to push the door open? Most large stores have automatic doors that sense your presence and open for you. Any door will enable you to enter a building, but auto- matic doors don’t require that you push or pull them open. Similarly, many public facilities have restrooms with automatic water faucets and towel dispensers. Although not quite as prevalent as automatic supermarket doors, these devices don’t ask much of you and instead are happy to dispense water and towels. And I honestly don’t remember the last time I even saw an ice tray, much less filled it with water or cracked it to get ice for a glass of water. My refrigerator/freezer some- how magically always has ice for me and is at the ready to fill a glass for me. I bet you can think of countless ways that modern life is automated with devices that work for you, not the other way around. With all of this automation 23
Image of page 4
24 C HAPTER 2 Developing your first Spring Boot application everywhere, you’d think that we’d see more of it in our development tasks. Strangely, that hasn’t been so. Up until recently, creating an application with Spring required you to do a lot of work for the framework. Sure, Spring has long had fantastic features for developing amazing applications. But it was up to you to add all of the library dependencies to the project’s build specification. And it was your job to write configuration to tell Spring what to do. In this chapter, we’re going to look at two ways that Spring Boot has added a level of automation to Spring development: starter dependencies and automatic configura- tion. You’ll see how these essential Spring Boot features free you from the tedium and distraction of enabling Spring in your projects and let you focus on actually develop- ing your applications. Along the way, you’ll write a small but complete Spring applica- tion that puts Spring Boot to work for you.
Image of page 5
Image of page 6

You've reached the end of your free preview.

Want to read all 30 pages?

  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes