|
@@ -12,6 +12,9 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Enumeration;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
/**
|
|
@@ -27,6 +30,15 @@ public class AccessBehaviorInterceptor implements HandlerInterceptor {
|
|
|
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
|
|
|
try {
|
|
|
WebAppContext.current().init();
|
|
|
+
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
+ Enumeration<String> headerNames = httpServletRequest.getHeaderNames();
|
|
|
+ while (headerNames != null && headerNames.hasMoreElements()) {
|
|
|
+ String hn = headerNames.nextElement();
|
|
|
+ headers.put(hn, httpServletRequest.getHeader(hn));
|
|
|
+ }
|
|
|
+ logger.info("AccessBehaviorInterceptor#preHandle():headers = {}", headers);
|
|
|
+
|
|
|
WebAppContext.current().setRequestStartTime(System.currentTimeMillis());
|
|
|
WebAppContext.current().setRequestID(UUID.randomUUID().toString());
|
|
|
WebAppContext.current().setIP(WebHelper.getIP(httpServletRequest));
|