3. src/main/Java 폴더에 com.springmvc.interceptor 패키지를 생성하고 이 패키지에 MonitoringInterceptor 클래스를 만들어 다음 내용을 작성합니다.
코드 11-3 MonitoringInterceptor.java
package com.springmvc.interceptor;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StopWatch;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
public class MonitoringInterceptor implements HandlerInterceptor {
ThreadLocal<StopWatch> stopWatchLocal = new ThreadLocal<StopWatch>();
public Logger logger = LoggerFactory.getLogger(this.getClass()); ➊