반응형
@Controller Annotation은 @Component Annotation과 처럼 컴포넌트 스캔 대상
그래서, context:component-scan 태그를 이용해서 @Controller Annotation이 적용된 컨트롤러 Class를 자동으로 로딩할 수 있다.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="[http://www.springframework.org/schema/beans"](http://www.springframework.org/schema/beans%22)
xmlns:context="[http://www.springframework.org/schema/context"](http://www.springframework.org/schema/context%22)
xmlns:p="[http://www.springframework.org/schema/p"](http://www.springframework.org/schema/p%22)
xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance%22)
xsi:schemaLocation="[http://www.springframework.org/schema/beans](http://www.springframework.org/schema/beans)
[http://www.springframework.org/schema/beans/spring-beans-3.0.xsd](http://www.springframework.org/schema/beans/spring-beans-3.0.xsd)
[http://www.springframework.org/schema/context](http://www.springframework.org/schema/context)
[http://www.springframework.org/schema/context/spring-context-3.0.xsd">](http://www.springframework.org/schema/context/spring-context-3.0.xsd%22%3E)
<context:component-scan base-package="컨트롤러 주소" />
</beans>
반응형
'Java > SPRING' 카테고리의 다른 글
스프링 프레임워크 [Spring Framework] COOKIE 쿠키 객체 (0) | 2021.12.23 |
---|---|
스프링 [Spring]Spring MVC중 View란? (0) | 2021.12.22 |
스프링 프레임워크 [Spring Framework] MVC 컨트롤러(Controller) 메서드의 파라미터 타입 (0) | 2021.12.22 |
스프링 프레임워크 [Spring Framework] MVC 커맨드(Command) 객체로 List 받기 (0) | 2021.12.22 |
스프링 프레임워크 [SPRING Framework] MVC 메서드 HTTP 전송 방식. (0) | 2021.12.21 |