-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathRootConfig.java
More file actions
34 lines (31 loc) · 1.34 KB
/
RootConfig.java
File metadata and controls
34 lines (31 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.bobocode.config;
import net.bytebuddy.implementation.bind.annotation.IgnoreForBinding;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
/**
* This class provides application root (non-web) configuration for a basic spring application context
* (containing middle-tire services, datasource, etc.).
* The configuration must exclude the web layer of the application.
* <p>
* todo: mark this class as config
* todo: enable component scanning for all packages in "com.bobocode"
* todo: ignore all web related config and beans (ignore @{@link Controller}, ignore {@link EnableWebMvc}) using exclude filter
*/
@Configuration
@ComponentScan(basePackages = "com.bobocode",
excludeFilters = {
@Filter(
type = FilterType.ANNOTATION,
classes = EnableWebMvc.class
),
@Filter(
type = FilterType.ANNOTATION,
classes = Controller.class
)
})
public class RootConfig {
}