Example usage for org.springframework.web.context.request RequestAttributes resolveReference

List of usage examples for org.springframework.web.context.request RequestAttributes resolveReference

Introduction

In this page you can find the example usage for org.springframework.web.context.request RequestAttributes resolveReference.

Prototype

@Nullable
Object resolveReference(String key);

Source Link

Document

Resolve the contextual reference for the given key, if any.

Usage

From source file:org.jdal.vaadin.VaadinUtils.java

public static HttpSession getSession() {
    RequestAttributes ra = RequestContextHolder.getRequestAttributes();

    return (HttpSession) (ra != null ? ra.resolveReference(RequestAttributes.REFERENCE_SESSION) : null);
}

From source file:darks.orm.web.context.SpringRequestHolder.java

@Override
public HttpSession getSession() {
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    return (HttpSession) attributes.resolveReference(SessionKey);
}

From source file:darks.orm.web.context.SpringRequestHolder.java

@Override
public HttpServletRequest getRequest() {
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    return (HttpServletRequest) attributes.resolveReference(RequestKey);
}

From source file:org.joinfaces.annotations.ViewScope.java

@Override
public Object resolveContextualObject(String key) {
    RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
    return attributes.resolveReference(key);
}

From source file:uk.ac.ebi.intact.editor.util.HybridSessionThreadScope.java

public Object resolveContextualObject(String key) {
    if (RequestContextHolder.getRequestAttributes() != null) {
        RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
        return attributes.resolveReference(key);
    }/*from w  ww  .ja va 2 s  .  co  m*/

    return null;
}

From source file:com.sibvisions.rad.server.security.spring.authentication.SecurityManagerPreparerApplicationListener.java

/**
 * {@inheritDoc}//from  w  ww.j  ava2s  .c o  m
 */
public void onApplicationEvent(InteractiveAuthenticationSuccessEvent pEvent) {
    RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();

    if (requestAttributes != null) {
        Object request = requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);

        if (request != null && request instanceof HttpServletRequest) {
            doPrepareParameters((HttpServletRequest) request);
        }
    }
}