java boot 컴포넌트 설정 후 서버 돌릴때

HUGO·2022년 9월 26일
0

mybatis

목록 보기
6/6
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

// 서비스(service), 컨트롤러(controller), 환경설정(config)
@ComponentScan(basePackages = {	// 컴포넌트 스캔해야함
	"com.example.service", 
	"com.example.controller",
	"com.example.restcontroller",
	"com.example.config",
	"com.example.handler"
})

// mybatis => mapper
@MapperScan(basePackages = "com.example.mapper")


@EnableRedisHttpSession
@SpringBootApplication
public class Boot20220915Application {

	public static void main(String[] args) {
		SpringApplication.run(Boot20220915Application.class, args);
	}

}
profile
갓 신생아 개발자 이야기

0개의 댓글