본문 바로가기
Language/SPRING

[web 프로젝트 만들기] servlet-context.xml 설정

by 박살낼겨 2022. 12. 22.

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:p="http://www.springframework.org/schema/p"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:task="http://www.springframework.org/schema/task"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-4.0.xsd

 

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-4.0.xsd

 

http://www.springframework.org/schema/mvc

http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd

 

http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-4.0.xsd

 

http://www.springframework.org/schema/task

http://www.springframework.org/schema/task/spring-task-4.0.xsd">

 

 

<mvc:annotation-driven />

<context:annotation-config />

 

<!-- 정적(statical) 리소스(예:js, css 등)를 서비스 시 이 명령을 통해 접근가능-->

<!-- 아래 지정해준 디렉토리에 정적 리소스 파일들이 있으면 된다. -->

<!-- <mvc:resources location="/assets/" mapping="/assets/**"></mvc:resources> -->

 

<!-- use-default-filters는 기본 true 디폴트(@Component, @Controller, @Service, @Repository) -->

<!-- false일 경우는 디폴트 어노테이션 스캔하지 않음, 그래서 커스터마이징 할 수 있음 -->

<context:component-scan base-package="com.biz.bizPart.*" use-default-filters="true">

<!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> -->

</context:component-scan>

<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="0" p:prefix="/WEB-INF/views/" p:suffix=".jsp" p:viewClass="org.springframework.web.servlet.view.JstlView" />

 

</beans>