Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.weld.context.http;
 
 import  javax.servlet.http.HttpServletRequest;
 import  javax.servlet.http.HttpSession;
 
public class HttpConversationContextImpl extends AbstractConversationContext<HttpServletRequest, HttpSession> implements HttpConversationContext {
    // There is no need to store FQCN in a session key
    private static final String NAMING_SCHEME_PREFIX = "WELD_C";
    public HttpConversationContextImpl(String contextIdBeanIdentifierIndex beanIdentifierIndex) {
        super(contextIdbeanIdentifierIndex);
    }
    @Override
    protected void setSessionAttribute(HttpServletRequest requestString nameObject valueboolean create) {
        if (create || SessionHolder.getSessionIfExists() != null) {
            getSessionFromRequest(requesttrue).setAttribute(namevalue);
        }
    }
    @Override
    protected Object getSessionAttribute(HttpServletRequest requestString nameboolean create) {
        if (create || SessionHolder.getSessionIfExists() != null) {
            return getSessionFromRequest(requesttrue).getAttribute(name);
        } else {
            return null;
        }
    }
    @Override
    protected void removeRequestAttribute(HttpServletRequest requestString name) {
        request.removeAttribute(name);
    }
    @Override
    protected void setRequestAttribute(HttpServletRequest requestString nameObject value) {
        request.setAttribute(namevalue);
    }
    @Override
    protected Object getRequestAttribute(HttpServletRequest requestString name) {
        return request.getAttribute(name);
    }
    @Override
    protected BoundBeanStore createRequestBeanStore(NamingScheme namingScheme, HttpServletRequest request) {
        return new LazySessionBeanStore(requestnamingScheme);
    }
    @Override
    protected BoundBeanStore createSessionBeanStore(NamingScheme namingScheme, HttpSession session) {
        return new EagerSessionBeanStore(namingSchemesession);
    }
    @Override
    protected Object getSessionAttributeFromSession(HttpSession sessionString name) {
        return session.getAttribute(name);
    }
    @Override
    protected HttpSession getSessionFromRequest(HttpServletRequest requestboolean create) {
        return SessionHolder.getSession(requestcreate);
    }
    @Override
    protected String getNamingSchemePrefix() {
        return ;
    }
New to GrepCode? Check out our FAQ X