Announcement Announcement Module
No announcement yet.
Spring Scope Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Scope

    If a class A has a reference to B and class C is also having the same composite reference to B,but by default bean scope is singleton so in the session if we want to access the two objects then both A & C will be holding the same object of B because its singleton.since it has no meaning why this is taking the singleton scope.Is it make sense.?

  • #2
    If you need sessionwise different objects then you can use Session scope instead default singleton


    • #3
      Thanks for the reply Mr.Rohan

      My Question is in the same transaction if i use these two objects by default it will be singleton so both will hold the same copy rite.then my both objects will be holding the same copy ,then we have to manually force this to be prototype or something else rite. why did they defined it as singleton..they would have made it as prototype itself.

      Last edited by Rathi; Dec 12th, 2011, 12:29 PM.