본문 바로가기
카테고리 없음

인터셉터 구현하기

by 그리득 2023. 12. 11.
728x90

 

 

servlet-context.xml

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

     태그안에 작성

</beans:beans>

 

<beans:beans xmlns="http://www.springframework.org/schema/mvc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:beans="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:websocket="http://www.springframework.org/schema/websocket"
	xsi:schemaLocation="http://www.springframework.org/schema/websocket https://www.springframework.org/schema/websocket/spring-websocket-4.3.xsd
		http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
	
	<!-- 인터셉터 적용설정하기 -->
	<interceptors>
		<interceptor>
			<mapping path="/member/*"/>
			<beans:bean class="com.bs.spring.common.interceptor.LoggerIntercepter"/>
		</interceptor>
		<interceptor>
			<mapping path="/demo/*"/>
			<exclude-mapping path="/demo/demoList.do"/>
			<beans:ref bean="loginCheckInterceptor"/>
		</interceptor>
	</interceptors>
	
</beans:beans>