Sudheer Palyam
Sudheer Palyam

Reputation: 2519

Spring annotations : setting @sessionAttributes in @component class

Is it possible to set a session attribute in a manager class (class which is not a controller and is marked as @component)? The scenario is like this, from my Controller i'm calling a manager class which does some logic. I want to store the result of this logic in the session, so that i can use it in the later requests.

Upvotes: 1

Views: 1154

Answers (1)

axtavt
axtavt

Reputation: 242726

No. @SessionAttribute is a controller-specific concept. To get similar behaviour in other components you can use session-scoped beans.

Upvotes: 2

Related Questions