0

In a spring MVC web application, I wanna store user information at the request scope, in the filer or interceptor I will build the user information and store it and use it later within this request.I know in spring I can create request scope spring beans, but these beans can only be accessed within the request thread(maybe the child thread).However I will access the user information in the thread pool.So the build in request scope spring bean may not suitable for me. Any tip for store information share among threads within the request scope?

3
  • Check this out, see if it helps you: stackoverflow.com/questions/3320674/… You can @Autowire the request into your beans. Commented Dec 18, 2016 at 16:11
  • @bipotato911 are you trying to build login or user authentication ? for that you should be using spring security. And if you want to share some data across multiple requests for a particular user you can use session. Commented Dec 18, 2016 at 17:44
  • @gajendrakumar actually I want to share data within one request but among threads.When user make a request I will collect the user info and the app info, then in the following business logic I will use the information in the thread pool task Commented Dec 19, 2016 at 4:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.