use of org.springframework.web.context.request.ServletRequestAttributes in project shiro by apache.
the class RestrictedErrorController method error.
@RequestMapping(ERROR_PATH)
String error(HttpServletRequest request, Model model) {
Map<String, Object> errorMap = errorAttributes.getErrorAttributes(new ServletRequestAttributes(request), false);
model.addAttribute("errors", errorMap);
return "error";
}
use of org.springframework.web.context.request.ServletRequestAttributes in project pivotal-cla by pivotalsoftware.
the class ClaRequest method signUrl.
private String signUrl() throws Exception {
ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = requestAttributes.getRequest();
return UrlBuilder.signUrl().request(request).claName(claName).repositoryId(repositoryId).pullRequestId(pullRequestId).build();
}
use of org.springframework.web.context.request.ServletRequestAttributes in project ngtesting-platform by aaronchen2k.
the class StringUtil method getMessage.
/**
* 获得i18n字符串
*/
public static String getMessage(String code, Object[] args) {
LocaleResolver localLocaleResolver = SpringContextHolder.getBean(LocaleResolver.class);
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
Locale localLocale = localLocaleResolver.resolveLocale(request);
return SpringContextHolder.getApplicationContext().getMessage(code, args, localLocale);
}
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());
}
Aggregations