You are on page 1of 6

Spring Boot Joke App

Spring Boot Jokes App


1. Create Spring Boot Project from Spring Initializr

1.1. Only select ‘Web’ and ‘Thymeleaf’ dependencies


2. Add Dependency: group: 'guru.springframework',
name: 'chuck-norris-for-actuator', version: ‘0.0.2'

3. Create Service to return joke string from class


guru.springframework.norris.chuck.ChuckNorrisQuot
es.getRandomQuote()
Spring Boot Jokes App (cont.)
4. Create Spring MVC Jokes controller

5. Map context root (“/“, “”) to Jokes view

6. Add Joke text to ‘joke’ property of Model

7. Return view name of ‘chucknorris’

8. Create Thymeleaf view for ‘chucknorris’.


Spring Boot Jokes App (cont.)
9. Display Joke string property

10.Run App

11.Refresh for more Chuck Norris Jokes!

You might also like