[undertow-dev] Sharing session attributes in NonBlocking Handlers and Traditional Servlets

Lightspoke Discussion lsgroup at gmail.com
Mon Feb 17 14:38:58 EST 2014


Hello,

Does anyone know how you might go about sharing session attributes between
a servlet and a non-blocking handler in the same project?

        InMemorySessionManager sessman = new
InMemorySessionManager(foundsessid);
        SessionAttachmentHandler sessattach = new
SessionAttachmentHandler(sessman, sessconf);
        SessionManager regsessman = sessattach.getSessionManager();

        Session session;
        session = sessman.getSession(exchange, sessconf);
        //returns null



        SessionCookieConfig sessconf = new SessionCookieConfig();
        String foundsessid = sessconf.findSessionId(exchange);
        session = regsessman.getSession(foundsessid);
        System.out.println("getsession by id ="+session );
        //returns null


        session = regsessman.createSession(exchange, sessconf);
        System.out.println("create session  ="+session );

        //returns a session - but ...

1. session attributes from servlet do not return its value and
2. session attributes across http requests do not persist in memory

Thanks in advance!




-- 
--
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140217/60884bae/attachment.html 


More information about the undertow-dev mailing list