@Override @Nullable public Object resolveContextualObject(String key) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); return attributes.resolveReference(key); }
@Override @Nullable public Object resolveContextualObject(String key) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); return attributes.resolveReference(key); }
RequestAttributes attrs = RequestContextHolder.getRequestAttributes(); // According to JavaDoc, PortletRequest should be available PortletRequest request = (PortletRequest) attrs.resolveReference("request");
@Override @Nullable public Object resolveContextualObject(String key) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); return attributes.resolveReference(key); }
protected HttpSession getHttpSession() { return (HttpSession) RequestContextHolder.currentRequestAttributes() .resolveReference(RequestAttributes.REFERENCE_SESSION); } }
@Override public Object resolveContextualObject(String key) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); return attributes.resolveReference(key); } }
protected HttpServletRequest getHttpRequestServlet() { return (HttpServletRequest) RequestContextHolder.currentRequestAttributes() .resolveReference(RequestAttributes.REFERENCE_REQUEST); }
@Override @Nullable public Object resolveContextualObject(String key) { RequestAttributes attributes = RequestContextHolder.currentRequestAttributes(); return attributes.resolveReference(key); }
private View resolveViewWithAcceptHeader(String viewName, Locale locale) { HttpServletRequest request = (HttpServletRequest) RequestContextHolder.currentRequestAttributes() .resolveReference(RequestAttributes.REFERENCE_REQUEST); String accept = request.getHeader(ACCEPT_HEADER); for (Map.Entry<String, CatnapWrappingView> entry : views.entrySet()) { if (entry.getValue().getContentType().equals(accept)) { logger.debug("Resolved view [{}] with Accept header [{}]", viewName, entry.getValue().getContentType()); return entry.getValue(); } } return null; }