Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Spring Basics Spring Components and Configuring Our App Configure a Spring Application

venkatesh chennakesavula
PLUS
venkatesh chennakesavula
Courses Plus Student 1,113 Points

how

how to move to next tutorial ?

com/teamtreehouse/sample/SpringConfig.java
package com.teamtreehouse.sample;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

public class SpringConfig {
Joshua Small
Joshua Small
1,064 Points

Venkatesh,

Go back a few videos watch adding a Spring Configuration File. All you need to do is add @EnableAutoConifguration above the SpringConfig class.

J

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

You have to:

Apply the appropriate annotation to the application configuration class in SpringConfig.java so that Spring Boot will auto-configure your Spring app upon deployment.

This means you have to use annotation on class SpringConfig.

Hint: both annotations are imported for you:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

All you have to do is to choose one, that enables auto configuration of your spring app ...

Do you see where it leads to ?

If you feel unfamiliar with what annotation is, please take this course:

https://teamtreehouse.com/library/java-annotations