problem with push data to a selected user

View: New views
4 Messages — Rating Filter:   Alert me  

problem with push data to a selected user

by robyp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have to push data only to a particolar sub-set of user.
i hope that you can answer at least one of my question, maybe the first please!:(..here they are:

1) first of all, i have to push data to only one user. The users open the browser at same page (index.jsp).I use scriptsession, like in http://directwebremoting.org/dwr/reverse-ajax/hints-and-tips.html

i set a session attribute (or key) like user_id and i try to do push to user with id like required user_id:

 String userid = ((String)scriptSession.getAttribute("user_id"));
        if (userid!=null && userid.equals("roby")){
Browser.withSession(scriptSession.getId(), new Runnable() {
                public void run() {
//push data to html page for user with user_id=roby
...
..
}

why doesn't work? it push to everyone user with a browser listen to the same page instead one of them :(

2) if i would to send data to a subset of user there is something filter to use?

3)is script session the right and the only method to differentiate users?


thank you very much

roby


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: problem with push data to a selected user

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Please don't cross-post your questions to all the DWR lists.
dwr-users is sufficient.

Best regards
Mike Wilson

ytrewq2002@... wrote:

> I have to push data only to a particolar sub-set of user.
> i hope that you can answer at least one of my question, maybe
> the first please!:(..here they are:
>
> 1) first of all, i have to push data to only one user. The
> users open the browser at same page (index.jsp).I use
> scriptsession, like in
> http://directwebremoting.org/dwr/reverse-ajax/hints-and-tips.html
>
> i set a session attribute (or key) like user_id and i try to
> do push to user with id like required user_id:
>
>  String userid = ((String)scriptSession.getAttribute("user_id"));
>         if (userid!=null && userid.equals("roby")){
> Browser.withSession(scriptSession.getId(), new Runnable() {
>                 public void run() {
> //push data to html page for user with user_id=roby
> ...
> ..
> }
>
> why doesn't work? it push to everyone user with a browser
> listen to the same page instead one of them :(
>
> 2) if i would to send data to a subset of user there is
> something filter to use?
>
> 3)is script session the right and the only method to
> differentiate users?
>
>
> thank you very much
>
> roby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: problem with push data to a selected user

by Lance Java :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At what stage do you put "user_id" on the script session? You might want to post the code.
2009/10/30 ytrewq2002@... <ytrewq2002@...>
I have to push data only to a particolar sub-set of user.
i hope that you can answer at least one of my question, maybe the first please!:(..here they are:

1) first of all, i have to push data to only one user. The users open the browser at same page (index.jsp).I use scriptsession, like in http://directwebremoting.org/dwr/reverse-ajax/hints-and-tips.html

i set a session attribute (or key) like user_id and i try to do push to user with id like required user_id:

 String userid = ((String)scriptSession.getAttribute("user_id"));
       if (userid!=null && userid.equals("roby")){
Browser.withSession(scriptSession.getId(), new Runnable() {
               public void run() {
//push data to html page for user with user_id=roby
...
..
}

why doesn't work? it push to everyone user with a browser listen to the same page instead one of them :(

2) if i would to send data to a subset of user there is something filter to use?

3)is script session the right and the only method to differentiate users?


thank you very much

roby


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Parent Message unknown Re: problem with push data to a selected user

by robyp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok this is my code..
thank you

Roby
---------- Initial Header -----------

From      : "Lance Java" lance.java@...
To          : users@...
Cc          :
Date      : Fri, 30 Oct 2009 14:18:19 +0000
Subject : Re: [dwr-user] problem with push data to a selected user

> At what stage do you put "user_id" on the script session? You might want to
> post the code.
> 2009/10/30 ytrewq2002@... <ytrewq2002@...>
>
> > I have to push data only to a particolar sub-set of user.
> > i hope that you can answer at least one of my question, maybe the first
> > please!:(..here they are:
> >
> > 1) first of all, i have to push data to only one user. The users open the
> > browser at same page (index.jsp).I use scriptsession, like in
> > http://directwebremoting.org/dwr/reverse-ajax/hints-and-tips.html
> >
> > i set a session attribute (or key) like user_id and i try to do push to
> > user with id like required user_id:
> >
> >  String userid = ((String)scriptSession.getAttribute("user_id"));
> >        if (userid!=null && userid.equals("roby")){
> > Browser.withSession(scriptSession.getId(), new Runnable() {
> >                public void run() {
> > //push data to html page for user with user_id=roby
> > ...
> > ..
> > }
> >
> > why doesn't work? it push to everyone user with a browser listen to the
> > same page instead one of them :(
> >
> > 2) if i would to send data to a subset of user there is something filter to
> > use?
> >
> > 3)is script session the right and the only method to differentiate users?
> >
> >
> > thank you very much
> >
> > roby
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@...
> > For additional commands, e-mail: users-help@...
> >
> >
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

=?iso-8859-1?Q?[not_work]DwrSessionSpike.zip?= (6K) Download Attachment