servlet-context.xml
아래 코드는 내가 이해하기 쉽게 위치를 분할하고 수정해서 붙여 놓은 것임.
※ <interceptor></interceptor>들은
<interceptors></interceptors> 안에 위치해야함.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<!-- 인터셉터 설정 / 동작 경로 -->
<!-- 로그인처리 인터셉터 (로그인유지) -->
<beans:bean id="loginInterceptor"
class="kr.xxx.yyyy.interceptor.LoginInterceptor"></beans:bean>
<interceptor>
<mapping path="/member/signin"/>
<beans:ref bean="loginInterceptor"/>
</interceptor>
<!-- 자동 로그인 처리 인터셉터 (자동로그인유지) -->
<beans:bean id="autoLoginInterceptor"
class="kr.xxx.yyyy.interceptor.AutoLoginInterceptor"></beans:bean>
<interceptor>
<mapping path="/**/"/>
<beans:ref bean="autoLoginInterceptor"/>
</interceptor>
<!-- 비회원만 접근할 수 있게 하는 인터셉터 -->
<beans:bean id="guestInterceptor"
class="kr.xxx.yyyy.interceptor.GuestInterceptor"></beans:bean>
<interceptor>
<mapping path="/member/signup"/>
<mapping path="/member/signin"/>
<beans:ref bean="guestInterceptor"/>
</interceptor>
<!-- 회원만 접근할 수 있게 하는 인터셉터 -->
<beans:bean id="userInterceptor"
class="kr.xxx.yyyy.interceptor.UserInterceptor"></beans:bean>
<interceptor>
<mapping path="/abcd/*"/>
<mapping path="/board/register"/>
<mapping path="/board/modify"/>
<mapping path="/board/detail"/>
<mapping path="/board/delete"/>
<beans:ref bean="userInterceptor"/>
</interceptor>
<!-- 관리자만 접근할 수 있게 하는 인터셉터 -->
<beans:bean id="adminInterceptor"
class="kr.xxx.yyyy.interceptor.AdminInterceptor"></beans:bean>
<interceptor>
<mapping path="/admin/**/"/>
<beans:ref bean="adminInterceptor"/>
</interceptor>
|
cs |
'SPRING > 연습장' 카테고리의 다른 글
게시판 페이징 처리 (pagination) [2] - 원래 있던 페이지 번호로 돌아가기 (0) | 2021.08.29 |
---|---|
게시판 페이징 처리 (pagination) [1] - 페이지네이션 기본 구현 (0) | 2021.08.27 |
form안의 데이터를 한 번에 묶어 ajax로 전송하기 (0) | 2021.08.17 |
session과 cookie를 이용한 자동 로그인 기능 (0) | 2021.08.17 |
jsp에서 보낸 이메일 주소가 controller에서 잘려 받아질 때 (0) | 2021.08.10 |