250x250
Notice
Recent Posts
Recent Comments
Link
목록interceptor (1)
관심쟁이 영호
[ADYB] Session이 없으면 특정페이지 접근못하게 하기
오늘은 Session이 없으면 특정 페이지에 접근을 하지 못하게 하는 작업을 할 것이다. 목차 전략 인터셉터 생성 WebConfig 등록 전략 특정 페이지 URL 요청 시, Interceptor를 통해서 세션을 확인한다. 세션이 존재하지 않을 경우 "home"으로 redirect해준다. 세션 체크를 할 특정 페이지는 회원 수정, 게시판 글 작성이다. 인터셉터 생성 - 먼저 인터셉터를 생성하자. SessionCheckInterceptor.java @Slf4j public class SessionCheckInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServ..
Project/ADYB - 쇼핑몰
2021. 8. 3. 15:48