Example usage for javax.servlet.http HttpSessionEvent getSession

List of usage examples for javax.servlet.http HttpSessionEvent getSession

Introduction

In this page you can find the example usage for javax.servlet.http HttpSessionEvent getSession.

Prototype

public HttpSession getSession() 

Source Link

Document

Return the session that changed.

Usage

From source file:com.sonoport.spring.SessionListener.java

@Override
public void sessionCreated(HttpSessionEvent event) {
    final ServletContext servletContext = event.getSession().getServletContext();
    final WebApplicationContext context = WebApplicationContextUtils
            .getRequiredWebApplicationContext(servletContext);
    ApplicationContextLocator.setApplicationContext(context);
}

From source file:com.remediatetheflag.global.servlets.SessionListener.java

@Override
public void sessionDestroyed(HttpSessionEvent sessionEvent) {
    User user = (User) sessionEvent.getSession().getAttribute(Constants.ATTRIBUTE_SECURITY_CONTEXT);
    if (null != user) {
        logger.debug("Session Listener: session destroyed for user: " + user.getUsername());
        UserAuthenticationEvent attempt = new UserAuthenticationEvent();
        attempt.setLogoutDate(new Date());
        attempt.setUsername(user.getUsername());
        attempt.setSessionIdHash(DigestUtils.sha256Hex(sessionEvent.getSession().getId()));
        hpc.addLogoutEvent(attempt);/*from ww w . ja  v a2s  . com*/
    }
}

From source file:de.interseroh.report.webapp.SessionListener.java

private ApplicationContext getApplicationContext(HttpSessionEvent event) {
    HttpSession session = event.getSession();
    ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(session.getServletContext());
    return ctx;/*  w  ww  .  j  av  a  2  s .  co m*/
}

From source file:nl.b3p.web.SharedSessionData.java

public void sessionCreated(HttpSessionEvent event) {
    HttpSession session = event.getSession();
    log.debug("adding a map for session: " + session.getId());
    sessions.put(session.getId(), new ConcurrentHashMap<String, String>(8));
}

From source file:org.apache.axis.transport.http.AxisHTTPSessionListener.java

/**
 * Called when a session is destroyed by the servlet engine.  We use
 * the relevant HttpSession to look up an AxisHttpSession, and destroy
 * all the appropriate objects stored therein.
 *  //ww w  .  j  ava2 s.c  o m
 * @param event the event descriptor passed in by the servlet engine
 */
public void sessionDestroyed(HttpSessionEvent event) {
    HttpSession session = event.getSession();
    destroySession(session);
}

From source file:org.molasdin.wbase.jsf.spring.web.SpringBeansRewireListener.java

@Override
public void sessionDidActivate(HttpSessionEvent httpSessionEvent) {
    HttpSession session = httpSessionEvent.getSession();
    WebApplicationContext ctx = WebApplicationContextUtils
            .getRequiredWebApplicationContext(session.getServletContext());
    AutowireCapableBeanFactory bf = ctx.getAutowireCapableBeanFactory();
    for (String entry : IteratorUtils.asIterable(IteratorUtils.asIterator(session.getAttributeNames()))) {
        if (bf.containsBean(entry)) {
            Object bean = session.getAttribute(entry);
            bean = bf.configureBean(bean, entry);
            session.setAttribute(entry, bean);
        }/*from www  .ja v a  2  s.c om*/
    }

}

From source file:com.isalnikov.config.web.listener.UserServletContextListener.java

@Override
public void sessionCreated(HttpSessionEvent se) {
    System.out.println("==== sessionCreated ====" + se.getSession().getId());
    System.out.println(getPrincipal());
}

From source file:com.isalnikov.config.web.listener.UserServletContextListener.java

@Override
public void sessionDestroyed(HttpSessionEvent se) {
    System.out.println("==== sessionDestroyed ====" + se.getSession().getId());
    System.out.println(getPrincipal());
}

From source file:org.nuxeo.license.filter.LicenseGuardFilter.java

@Override
public void sessionDestroyed(HttpSessionEvent event) {
    String sid = event.getSession().getId();
    lm.releaseSession(sid);
}

From source file:gov.nih.nci.cma.util.CmaSessionListener.java

public void sessionCreated(HttpSessionEvent event) {
    System.out.println("Session created id=" + event.getSession().getId());
}