use of org.springframework.web.context.request.ServletRequestAttributes in project spring-boot-quick by vector4wang.
the class WebLogAspect method doBefore.
@Before("logPointCut()")
public void doBefore(JoinPoint joinPoint) throws Throwable {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
// 记录下请求内容
loggger.info("请求地址 : " + request.getRequestURL().toString());
loggger.info("HTTP METHOD : " + request.getMethod());
loggger.info("IP : " + request.getRemoteAddr());
loggger.info("CLASS_METHOD : " + joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
loggger.info("参数 : " + Arrays.toString(joinPoint.getArgs()));
// loggger.info("参数 : " + joinPoint.getArgs());
}
use of org.springframework.web.context.request.ServletRequestAttributes in project spring-boot-quick by vector4wang.
the class WebLogAspect method doBefore.
@Before("logPointCut()")
public void doBefore(JoinPoint joinPoint) throws Throwable {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
// 记录下请求内容
loggger.info("请求地址 : " + request.getRequestURL().toString());
loggger.info("HTTP METHOD : " + request.getMethod());
loggger.info("IP : " + request.getRemoteAddr());
loggger.info("CLASS_METHOD : " + joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
loggger.info("参数 : " + Arrays.toString(joinPoint.getArgs()));
// loggger.info("参数 : " + joinPoint.getArgs());
}
use of org.springframework.web.context.request.ServletRequestAttributes in project spring-boot-quick by vector4wang.
the class WebLogAspect method doBefore.
@Before("logPointCut()")
public void doBefore(JoinPoint joinPoint) throws Throwable {
// 接收到请求,记录请求内容
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
// 记录下请求内容
loggger.info("请求地址 : " + request.getRequestURL().toString());
loggger.info("HTTP METHOD : " + request.getMethod());
loggger.info("IP : " + request.getRemoteAddr());
loggger.info("CLASS_METHOD : " + joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
loggger.info("参数 : " + Arrays.toString(joinPoint.getArgs()));
// loggger.info("参数 : " + joinPoint.getArgs());
}
use of org.springframework.web.context.request.ServletRequestAttributes in project kork by spinnaker.
the class GenericErrorController method error.
@RequestMapping(value = "/error")
public Map error(@RequestParam(value = "trace", defaultValue = "false") Boolean includeStackTrace, HttpServletRequest httpServletRequest) {
ServletRequestAttributes servletRequestAttributes = new ServletRequestAttributes(httpServletRequest);
Map<String, Object> attributes = errorAttributes.getErrorAttributes(servletRequestAttributes, includeStackTrace);
Throwable exception = errorAttributes.getError(servletRequestAttributes);
if (exception != null && exception instanceof HasAdditionalAttributes) {
attributes.putAll(((HasAdditionalAttributes) exception).getAdditionalAttributes());
}
return attributes;
}
use of org.springframework.web.context.request.ServletRequestAttributes in project com.revolsys.open by revolsys.
the class HttpServletRequestJexlContext method getRequest.
private HttpServletRequest getRequest() {
final ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
final HttpServletRequest request = requestAttributes.getRequest();
return request;
}
Aggregations