java - Getting http-session from a child thread? -


i'm using spring framework , here's piece of code i'm using retirieve httpsession object:

servletrequestattributes attr; try {     attr = (servletrequestattributes) requestcontextholder             .currentrequestattributes(); } catch (exception e) { } httpsession session = attr.getrequest().getsession(false); 

the thing requestcontextholder

holder class expose web request in form of thread-bound requestattributes object.

therefore won't seen outside of thread created container handling request. there way retrieve session in child thread?

no there isn't. in servlet api, session property of request object. therefore, if don't have request, of many existing sessions retrieve?


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -