textHtmlHandler + sessionScript invalidated

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

textHtmlHandler + sessionScript invalidated

jmzc
Hello:

I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is invalidated
 ( with invalidate() method  )

I tried it setting

windows.dwr.engine._textHtmlHandler  = handler

but this function is never invoked


How I can to detect that a scriptSession was invalidated ( with
invalidate() method  ) ?
I can do it by coding and checking some things but I would like to
know if DWR supports this feature


Thanks and regards
Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

david@butterdev.com
See the bottom of the page:
http://directwebremoting.org/dwr/documentation/browser/errors.html

On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:

> Hello:
>
> I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is invalidated
>   ( with invalidate() method  )
>
> I tried it setting
>
> windows.dwr.engine._textHtmlHandler  = handler
>
> but this function is never invoked
>
>
> How I can to detect that a scriptSession was invalidated ( with
> invalidate() method  ) ?
> I can do it by coding and checking some things but I would like to
> know if DWR supports this feature
>
>
> Thanks and regards
>

Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

david@butterdev.com
Keep in mind textHtmlHandler is for an HttpSession, not a ScriptSession.

On the server side you can detect the invalidation of a ScriptSession by
configuring a custom listener:
http://directwebremoting.org/dwr/documentation/reverse-ajax/hints-and-tips.html#scriptSessionListeners

Keep in mind that when ReverseAjax is active on a page the ScriptSession
will not be invalidated under normal circumstances.  Are you calling
invalidate manually?


On 2013-12-05 05:08, David Marginian wrote:

> See the bottom of the page:
> http://directwebremoting.org/dwr/documentation/browser/errors.html
>
> On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:
>> Hello:
>>
>> I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is
>> invalidated
>>   ( with invalidate() method  )
>>
>> I tried it setting
>>
>> windows.dwr.engine._textHtmlHandler  = handler
>>
>> but this function is never invoked
>>
>>
>> How I can to detect that a scriptSession was invalidated ( with
>> invalidate() method  ) ?
>> I can do it by coding and checking some things but I would like to
>> know if DWR supports this feature
>>
>>
>> Thanks and regards
>>
Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

jmzc
In reply to this post by jmzc
>Keep in mind that when ReverseAjax is active on a page the ScriptSession
>will not be invalidated under normal circumstances.  Are you calling
>invalidate manually?


Yes, I do.



On 2013-12-05 05:08, David Marginian wrote:

> See the bottom of the page:
> http://directwebremoting.org/dwr/documentation/browser/errors.html
>
> On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:
>> Hello:
>>
>> I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is
>> invalidated
>>   ( with invalidate() method  )
>>
>> I tried it setting
>>
>> windows.dwr.engine._textHtmlHandler  = handler
>>
>> but this function is never invoked
>>
>>
>> How I can to detect that a scriptSession was invalidated ( with
>> invalidate() method  ) ?
>> I can do it by coding and checking some things but I would like to
>> know if DWR supports this feature
>>
>>
>> Thanks and regards
>>
«  [hide part of quote]
Remove Ads
« Return to DWR - Users  |  4 views
Powered by Nabble
Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

david@butterdev.com
Can you explain your use case a bit?

On 2013-12-05 11:46, Jose María Zaragoza wrote:

>> Keep in mind that when ReverseAjax is active on a page the
>> ScriptSession
>> will not be invalidated under normal circumstances.  Are you calling
>> invalidate manually?
>
>
> Yes, I do.
>
>
>
> On 2013-12-05 05:08, David Marginian wrote:
>
>> See the bottom of the page:
>> http://directwebremoting.org/dwr/documentation/browser/errors.html
>>
>> On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:
>>> Hello:
>>>
>>> I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is
>>> invalidated
>>>   ( with invalidate() method  )
>>>
>>> I tried it setting
>>>
>>> windows.dwr.engine._textHtmlHandler  = handler
>>>
>>> but this function is never invoked
>>>
>>>
>>> How I can to detect that a scriptSession was invalidated ( with
>>> invalidate() method  ) ?
>>> I can do it by coding and checking some things but I would like to
>>> know if DWR supports this feature
>>>
>>>
>>> Thanks and regards
>>>
> «  [hide part of quote]
> Remove Ads
> « Return to DWR - Users  |  4 views
> Powered by Nabble
Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

jmzc
2013/12/5 [hidden email] [via DWR]
<[hidden email]>:
> Can you explain your use case a bit?
>

When you open two tabs in a browser, HttpSession is shared between
these but ScriptSession ( I called it DWR session ) isn't

To avoid that problem, I want that when an user opens a new tab , if
there is an active DWR session ( saved as a HttpSession attribute)  ,
that DWR session be invalidated

The next step is how to report to the users that his session was invalidated


Thanks







> On 2013-12-05 11:46, Jose María Zaragoza wrote:
>
>>> Keep in mind that when ReverseAjax is active on a page the
>>> ScriptSession
>>> will not be invalidated under normal circumstances.  Are you calling
>>> invalidate manually?
>>
>>
>> Yes, I do.
>>
>>
>>
>> On 2013-12-05 05:08, David Marginian wrote:
>>
>>> See the bottom of the page:
>>> http://directwebremoting.org/dwr/documentation/browser/errors.html
>>>
>>> On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:
>>>> Hello:
>>>>
>>>> I'm using DWR 3.0 RC2 and I'm trying to detect when sessionScript is
>>>> invalidated
>>>>   ( with invalidate() method  )
>>>>
>>>> I tried it setting
>>>>
>>>> windows.dwr.engine._textHtmlHandler  = handler
>>>>
>>>> but this function is never invoked
>>>>
>>>>
>>>> How I can to detect that a scriptSession was invalidated ( with
>>>> invalidate() method  ) ?
>>>> I can do it by coding and checking some things but I would like to
>>>> know if DWR supports this feature
>>>>
>>>>
>>>> Thanks and regards
>>>>
>> «  [hide part of quote]
>> Remove Ads
>> « Return to DWR - Users  |  4 views
>> Powered by Nabble
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://dwr.2114559.n2.nabble.com/textHtmlHandler-sessionScript-invalidated-tp7580811p7580815.html
> To unsubscribe from textHtmlHandler + sessionScript invalidated, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: textHtmlHandler + sessionScript invalidated

Mike Wilson
Administrator
Ok, so it sounds like you want to enforce some kind of "single
active tab" policy for your website?

You probably have to solve this more on the application level.
The problem with invalidating the DWR/ScriptSession is that it
will be transparently created again and again on the server
as long as there is a client tab that calls on it.

So in addition to giving an error message to the user on the
"invalidated" tab, also make sure the page doesn't keep on
calling the server (through Reverse Ajax or other means).

Best regards
Mike Wilson

Jose María Zaragoza wrote:

> 2013/12/5 [hidden email] [via DWR]
> <[hidden email]>:
> > Can you explain your use case a bit?
> >
>
> When you open two tabs in a browser, HttpSession is shared between
> these but ScriptSession ( I called it DWR session ) isn't
>
> To avoid that problem, I want that when an user opens a new tab , if
> there is an active DWR session ( saved as a HttpSession attribute)  ,
> that DWR session be invalidated
>
> The next step is how to report to the users that his session
> was invalidated
>
>
> Thanks
>
>
>
>
>
>
>
> > On 2013-12-05 11:46, Jose María Zaragoza wrote:
> >
> >>> Keep in mind that when ReverseAjax is active on a page the
> >>> ScriptSession
> >>> will not be invalidated under normal circumstances.  Are
> you calling
> >>> invalidate manually?
> >>
> >>
> >> Yes, I do.
> >>
> >>
> >>
> >> On 2013-12-05 05:08, David Marginian wrote:
> >>
> >>> See the bottom of the page:
> >>> http://directwebremoting.org/dwr/documentation/browser/errors.html
> >>>
> >>> On 12/05/2013 04:51 AM, Jose María Zaragoza wrote:
> >>>> Hello:
> >>>>
> >>>> I'm using DWR 3.0 RC2 and I'm trying to detect when
> sessionScript is
> >>>> invalidated
> >>>>   ( with invalidate() method  )
> >>>>
> >>>> I tried it setting
> >>>>
> >>>> windows.dwr.engine._textHtmlHandler  = handler
> >>>>
> >>>> but this function is never invoked
> >>>>
> >>>>
> >>>> How I can to detect that a scriptSession was invalidated ( with
> >>>> invalidate() method  ) ?
> >>>> I can do it by coding and checking some things but I
> would like to
> >>>> know if DWR supports this feature
> >>>>
> >>>>
> >>>> Thanks and regards
> >>>>
> >> «  [hide part of quote]
> >> Remove Ads
> >> « Return to DWR - Users  |  4 views
> >> Powered by Nabble
> >
> >
> > ________________________________
> > If you reply to this email, your message will be added to
> the discussion
> > below:
> >
> http://dwr.2114559.n2.nabble.com/textHtmlHandler-sessionScript
> -invalidated-tp7580811p7580815.html
> > To unsubscribe from textHtmlHandler + sessionScript
> invalidated, click here.
> > NAML