<div dir="ltr">Hello,<div><br></div><div>Does anyone know how you might go about sharing session attributes between a servlet and a non-blocking handler in the same project?</div><div><br></div><div><div> InMemorySessionManager sessman = new InMemorySessionManager(foundsessid);</div>
<div> SessionAttachmentHandler sessattach = new SessionAttachmentHandler(sessman, sessconf); </div><div> SessionManager regsessman = sessattach.getSessionManager();</div><div> </div><div> Session session;</div>
<div> session = sessman.getSession(exchange, sessconf);</div><div> //returns null</div><div><br></div><div><br></div><div><br></div><div><div> SessionCookieConfig sessconf = new SessionCookieConfig();</div>
<div> String foundsessid = sessconf.findSessionId(exchange);</div></div><div><div> session = regsessman.getSession(foundsessid);</div><div> System.out.println("getsession by id ="+session );</div>
</div><div><div> //returns null</div></div><div><br></div><div><br></div><div> session = regsessman.createSession(exchange, sessconf);<br></div><div> System.out.println("create session ="+session );</div>
<div><br></div><div> //returns a session - but ...</div><div><br></div><div>1. session attributes from servlet do not return its value and </div><div>2. session attributes across http requests do not persist in memory</div>
<div><br></div><div>Thanks in advance!</div><div><br></div><div> </div><div><br></div><div><br></div>-- <br>--<br>Mike</div></div>