How to reach HTTPSession from Spring application (non-MVC)?

A

Azo80

I am using Spring framework on Tomcat and I need to pass some values
from HTTPHeader (values are retrieved by filter) to my WebService
application. I could store this values in HTTPSession, but I cannot
find any method to reach HTTP Session from my Spring application.

I've just found other solution, using ThreadLocal. I can pass values
from my filter to Spring bean (which is a singleton) but I find it
difficult to make it safe (every value set by my filter in ThreadLocal
need to be "consumed" by my spring bean, because of ThreadPool and
possibility of reusing thread).

Is there any other approach to solve this kind of problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top