I'm trying to use the MVC 2.0 framework to instantiate an object of a library.
I want to be able to instantiate this object every time I navig开发者_JAVA技巧ate my application with a differnt browser (creating new session) and call methods on this object from my controllers mantaining separated the objects of different sessions.
Where do I have to store and instantiate my object?
Thanks
If the object's scope is session then I'd store it in the session cache.
You'll want to test in the controller's constructor if it exists, if not then create and store in the session.
精彩评论