Example usage for javax.servlet.http HttpSession removeAttribute

List of usage examples for javax.servlet.http HttpSession removeAttribute

Introduction

In this page you can find the example usage for javax.servlet.http HttpSession removeAttribute.

Prototype

public void removeAttribute(String name);

Source Link

Document

Removes the object bound with the specified name from this session.

Usage

From source file:org.openmrs.module.rwandaprimarycare.PrimaryCareWebLogic.java

public static void clearSessionSearchAttributes(HttpSession session) {

    session.removeAttribute("addIdentifier");
    session.removeAttribute("FANAME");
    session.removeAttribute("RWNAME");
    session.removeAttribute("GENDER");
    session.removeAttribute("AGE");
    session.removeAttribute("BIRTHDATE_DAY");
    session.removeAttribute("BIRTHDATE_MONTH");
    session.removeAttribute("BIRTHDATE_YEAR");
    session.removeAttribute("MRWNAME");
    session.removeAttribute("FATHERSRWNAME");
    session.removeAttribute("COUNTRY");
    session.removeAttribute("PROVINCE");
    session.removeAttribute("DISTRICT");
    session.removeAttribute("SECTOR");
    session.removeAttribute("CELL");
    session.removeAttribute("UMUDUGUDU");

}

From source file:fll.web.schedule.UploadSchedule.java

/**
 * Clear out session variables used by the schedule upload workflow.
 *//*from  ww w  .j  av a2s.c o  m*/
public static void clearSesionVariables(final HttpSession session) {
    session.removeAttribute("uploadSchedule_file");
    session.removeAttribute("uploadSchedule_sheet");
    session.removeAttribute("uploadSchedule_schedule");
    session.removeAttribute("uploadSchedule_violations");
    session.removeAttribute(SCHEDULE_KEY);
    session.removeAttribute(MAPPINGS_KEY);
    session.removeAttribute(GatherEventDivisionChanges.EVENT_DIVISION_INFO_KEY);
    session.removeAttribute("sheetName");
    session.removeAttribute("sheetNames");
    session.removeAttribute(CheckViolations.SUBJECTIVE_STATIONS);
    session.removeAttribute(CheckViolations.UNUSED_HEADERS);
}

From source file:com.fruit.core.util.IWebUtils.java

/**
 * session/*from  www . j a  va  2s. c  om*/
 * @param HttpSession
 */
public static void removeCurrentSysUserFromSession(HttpSession httpSession) {
    httpSession.removeAttribute("sysUser");
}

From source file:com.swdouglass.joid.consumer.OpenIdFilter.java

public static void logout(HttpSession session) {
    session.removeAttribute(OPENID_ATTRIBUTE);
}

From source file:net.shibboleth.idp.oidc.util.OIDCUtils.java

/**
 * Remove session parameter.//from w  ww.  j av  a2  s  . co  m
 *
 * @param request   the request
 * @param parameter the parameter
 */
public static void removeSessionAttribute(final HttpServletRequest request, final String parameter) {
    final HttpSession session = request.getSession();
    session.removeAttribute(parameter);
}

From source file:org.tec.webapp.web.ControllerUtils.java

/**
 * clear the current user/* www .j a  v  a2s . c  om*/
 * @param session the current session
 * @return the current user
 */
public static UserBean clearCurrentUser(HttpSession session) {
    UserBean u = (UserBean) session.getAttribute(CURRENT_USER_KEY);

    if (u != null) {
        session.removeAttribute(CURRENT_USER_KEY);
    }

    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("clearing current user " + u);
    }

    return u;
}

From source file:com.jdon.strutsutil.FormBeanUtil.java

/**
 * ?attributeActionForm//from w  w w  . ja  va 2 s. co  m
 * 
 * @param mapping
 * @param request
 */
public static void removeActionForm(ActionMapping mapping, HttpServletRequest request) {
    if (mapping.getAttribute() != null) {
        if ("request".equals(mapping.getScope()))
            request.removeAttribute(mapping.getAttribute());
        else {
            HttpSession session = request.getSession();
            session.removeAttribute(mapping.getAttribute());
            request.removeAttribute(mapping.getAttribute());
        }
    }
}

From source file:com.alibaba.citrus.turbine.util.CsrfToken.java

public static void setTokensInSession(HttpSession session, String tokenKey, List<String> tokens) {
    if (tokens.isEmpty()) {
        session.removeAttribute(tokenKey);
    } else {/*from   ww  w.  jav a2s .  co  m*/
        session.setAttribute(tokenKey, StringUtil.join(tokens, CSRF_TOKEN_SEPARATOR));
    }
}

From source file:com.ixcode.framework.model.lookup.LookupHandler.java

/**
 * Cleans out the session ready for some new lookups to be defined.
 *//*  w  w w . j a v a  2s .  c om*/
public static void initialseLookupContext(HttpSession session) {
    if (log.isDebugEnabled()) {
        log.debug("<initialseLookupContext> : Created a new lookup context");
    }
    session.removeAttribute(SESSION_ATTR_LOOKUP_CONTEXT);
    session.setAttribute(SESSION_ATTR_LOOKUP_CONTEXT, new LookupContext());
}

From source file:org.jbpcc.admin.jsf.JsfUtil.java

public static void removeFromSession(SessionObjectKey sessionConstants) {
    FacesContext ctx = getCurrentFacesContext();
    HttpSession session = (HttpSession) ctx.getExternalContext().getSession(true);
    session.removeAttribute(sessionConstants.getKey());
}