I wonder if anyone can help with a conceptual problem I'm having with DWR? Where/how are my server-side objects which DWR calls methods on bound? Are these objects bound to a user http session?
I understand that DWR uses a main servlet that is used to route client-side method calls to appropriate server-side classes and methods, but how are the objects stored (i.e. how are they scoped, session or context etc?), and when are the server-side classes that I have programmed instantiated and when are they eligible for garbage collection?
For anyone that wants any context I am trying to include user authentication in each of my DWR server class constructors, but I need to be sure that each user will have their own instance of the server side class and not share them (because each user will have different privileges). My experiments have so far proved confusing...
The scope attribute is largely the same as the scope attribute as defined by the servlet spec. It allows you to specify what a bean is available to. The options are "application", "session", "request" and "page". These values should be familiar to Servlet and JSP developers.
The scope attribute is optional. It defaults to "page".
Joined: Jul 15, 2006
Many thanks - now I remember reading this page when I was first learning about DWR, but it completely escaped me!! Now I have set each of my bean creators scope attribute to session in the dwr.xml config file and everything is behaving as expected.
Your pointer to the documentation was great, and very much appreciated.
Daniel [ November 19, 2007: Message edited by: Daniel Bryant ]