servlet-context.xml


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

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

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

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

xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

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

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">



<context:annotation-config /> // 애노테이션 방식 사용

<mvc:annotation-driven /> // MVC 애노테이션 방식 사용


// 기본 애노테이션들을 빈으로 등록해준다 src/leadweb/* 모든 하위 디렉토리

<context:component-scan base-package="leadweb.*" />


// 파일 형식의 업로드 기능을 사용하고자 할 때 등록하는 bean

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>


// 뷰 리졸버 - 컨트롤러와 jsp의 맵핑

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">

<property name="prefix" value="/WEB-INF/jsp/"/>

<property name="suffix" value=".jsp"/>

</bean>


<mvc:interceptors>

<mvc:interceptor>

   <mvc:mapping path="/admin/**" /> // uri 가 context root/admin/** 모든 URL이 들어왔을때

// 인터셉터 등록

<bean class="leadweb.admin.interceptor.LoginCheckInterceptor" />

</mvc:interceptor>

</mvc:interceptors>


+ Recent posts