« Return to Thread: Keep track of ScriptSessions for one browser

Re: Re: Keep track of ScriptSessions for one browser

by Lance Java :: Rate this Message:

Reply to Author | View in Thread

One solution is to implement your own script session manager which intercepts script session creation, adding attributes to the script session based on the http session.

Later on, a reverse ajax thread can then differentiate between script sessions by their attributes.

<servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <display-name>DWR Servlet</display-name>
    <description>Direct Web Remoter Servlet</description>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
        <param-name>org.directwebremoting.extend.ScriptSessionManager</param-name>
        <param-value>foo.bar.MyScriptSessionManager</param-value>
    </init-param>
</servlet>

Not sure about looking up a script session by id... what's your use case?

Cheers,
Lance.

2008/5/8 Erlend Sobec <erlend.sobec@...>:
If this question has been asked so many times, I agree that it should definitely be in the FAQ.  However, since it isn't, perhaps you could tell me where I can find the answer rather than just tell me that it's been answered.  I did search and only found the solution for threads started by DWR, but in my case, the thread is NOT started by DWR so I can't just use WebContextFactory.get().getScriptSession().

Also, I asked where I can find info about the function getScriptSession(String id).  Has that also been answered?  If so where?

Thanks,

Erlend


On Wed, May 8, 2008 at 9:53 AM, Jose Noheda <jose.noheda@...> wrote:
> I think that we need a FAQ somewhere because this has been answered hundreds
> of times by now
>
> On Wed, May 7, 2008 at 10:39 PM, Erlend Sobec <erlend.sobec@...> wrote:
>
> > Is there a way to send back information to only one browser even though
> > multiple browsers are on the given page?
> >
> > My problem is that I have multiple users logged in accessing their data.
> > If there is an update for any given user, I don't want it to be sent to all
> > users currently logged in.
> >
> > I saw a post on how to deal with this if the thread is started by DWR, but
> > in my case it isn't. Also, in the javadoc there is mention of
> > getScriptSession(String id) but I can't find the method anywhere. Maybe I
> > could use this to determine which ScriptSession I need to send updates to.
> >
> > Thanks,
> >
> > Erlend
> >

 « Return to Thread: Keep track of ScriptSessions for one browser