Session is something in the Controller layer and should not be passed to the Service and Dao layers. You should extract the user information at the Controller layer and save it in the cache, and then the Service layer obtains the user information through userKey.
Just write a static method and pass HttpRequest into it
Or insert the session object into the method of the tool class.
You just need to pass httpRequest in.
request.getSession
Session is something in the Controller layer and should not be passed to the Service and Dao layers. You should extract the user information at the Controller layer and save it in the cache, and then the Service layer obtains the user information through userKey.