• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring framework Access Session Variables in helper classes

 
Kap Pat
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following is my code structure

Filter A{


Helper B() // Call to Helper B
int a= HelperA.function();
}
Like these There are multiple helper classes and multiple function calls being made

Helper B{

// Set the attributes in here Value in here
}



HelperA{

function(){

// Using the Session values
}
}
I am not able to relate how to use the sessionattribute notation in this case

Is there a property in Spring framework that will set the session value and can be accessed from any part of the Spring application There are too many function calls and it will be lot of tedious task to change the signature of all the methods
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You lost me? What is it your trying to do? Your sample code is a little bit to abstract I think. I don't understand what this has to do with sessionattribute. Is what you are looking for a session scoped bean that can be autowired in to your Spring services? Take a look here:

http://static.springsource.org/spring/docs/3.1.2.RELEASE/spring-framework-reference/html/beans.html#beans-factory-scopes-session
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic