Files
spring-boot-rest/spring-all/src/main/java/com/baeldung/contexts/config/RootApplicationConfig.java
Anand kumar d2880044df Spring Web Contexts (BAEL-82) (#2113)
* spring web contexts example

* applicationContext util added

* java based configuration added

* bean name fixed
2017-07-03 08:55:31 +02:00

20 lines
542 B
Java

package com.baeldung.contexts.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import com.baeldung.contexts.Greeting;
@Configuration
@ComponentScan(basePackages = { "com.baeldung.contexts.services" })
public class RootApplicationConfig {
@Bean
public Greeting greeting() {
Greeting greeting = new Greeting();
greeting.setMessage("Hello World !!");
return greeting;
}
}