1. servlet-context.xml 설정
<interceptors>
<interceptor>
<mapping path="/**/*" />
<exclude-mapping path="/main/*" />
<exclude-mapping path="/login/*" />
<beans:bean class="com.jeyun.controllers.HelloInterceptor"></beans:bean>
</interceptor>
</interceptors>
2. interceptor.java 설정
package com.text.controllers;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
public class Interceptor implements HandlerInterceptor {
public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object handler) {
return true;
}
public void postHandle(HttpServletRequest req, HttpServletResponse res, Object handler, ModelAndView mv) {
//
}
public void afterCompletion(HttpServletRequest req, HttpServletResponse res, Object handler, Exception ex) {
//
}
}
'java, jsp, spring, egov' 카테고리의 다른 글
hudson 자동배포 구성 (0) | 2017.10.20 |
---|---|
spring 3.x 데이터베이스 연동 (0) | 2016.04.15 |
spring3.1.1에서 3.2.8로 버전업 (0) | 2016.04.11 |
spring 3.x 타일즈(tiles2) 적용 (0) | 2016.04.09 |
java - 선행처리(pre) 및 후행처리(post) (0) | 2016.04.06 |