dwr.engine.setTextHtmlHandler not working

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

dwr.engine.setTextHtmlHandler not working

by tlteoh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DWR Version:  v2.0.2
Tomcat: v5.5
 
I had been searching in the internet long time and still can't find out the usage of the setTextHtmlHandler.  Below is my code in my jsp file inside the <head> section.
 
<script type="text/javascript">
    dwr.engine.setTextHtmlHandler(function() {
        alert("Session time out!!!");
    });
</script>
 
Then, inside my web.xml, I define my session time out for 1 minute.
 
<session-config>
    <session-timeout>1</session-timeout>
  </session-config>
 
After that, I start my tomcat 5.5 and access this jsp page.  Wait for very long, the setTextHtmlHandler function never call at all.  Is there something I had done wrong?

Thanks,
Teoh

Re: dwr.engine.setTextHtmlHandler not working

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm afraid it doesn't work that way...It's a little bit more complicated indeed. You should be reading how DWR reverse AJAX works. Then you would need a HttpSessionListener and push the data to the browser. Then you would be able to call setTextHtmlHandler.

Regards,

On Feb 16, 2008 11:16 AM, tlteoh <tlteoh@...> wrote:

DWR Version:  v2.0.2
Tomcat: v5.5

I had been searching in the internet long time and still can't find out the
usage of the setTextHtmlHandler.  Below is my code in my jsp file inside the
<head> section.

<script type="text/javascript">
   dwr.engine.setTextHtmlHandler(function() {
       alert("Session time out!!!");
   });
</script>

Then, inside my web.xml, I define my session time out for 1 minute.

<session-config>
   <session-timeout>1</session-timeout>
 </session-config>

After that, I start my tomcat 5.5 and access this jsp page.  Wait for very
long, the setTextHtmlHandler function never call at all.  Is there something
I had done wrong?

Thanks,
Teoh
--
View this message in context: http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p15516735.html
Sent from the DWR - Users mailing list archive at Nabble.com.


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



Re: dwr.engine.setTextHtmlHandler not working

by xeusman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Try the following link, you need to write an ajax filter. And there is no need for setTextHtmlHandler, you can throw an exception as usual.

http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html


tlteoh wrote:
DWR Version:  v2.0.2
Tomcat: v5.5
 
I had been searching in the internet long time and still can't find out the usage of the setTextHtmlHandler.  Below is my code in my jsp file inside the <head> section.
 
<script type="text/javascript">
    dwr.engine.setTextHtmlHandler(function() {
        alert("Session time out!!!");
    });
</script>
 
Then, inside my web.xml, I define my session time out for 1 minute.
 
<session-config>
    <session-timeout>1</session-timeout>
  </session-config>
 
After that, I start my tomcat 5.5 and access this jsp page.  Wait for very long, the setTextHtmlHandler function never call at all.  Is there something I had done wrong?

Thanks,
Teoh

Re: dwr.engine.setTextHtmlHandler not working

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interesting post, just one consideration, in the end <dwr:global-filter /> was discarded and global filters are declared using the same syntax as local ones (but outside a bean definition scope).

And that makes me wonder what happened to @GlobalFilter in the process..I have to check and update the ticket

On Tue, Mar 31, 2009 at 7:18 PM, xeusman <xeus_man@...> wrote:


Try the following link, you need to write an ajax filter. And there is no
need for setTextHtmlHandler, you can throw an exception as usual.

http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html



tlteoh wrote:
>
> DWR Version:  v2.0.2
> Tomcat: v5.5
>
> I had been searching in the internet long time and still can't find out
> the usage of the setTextHtmlHandler.  Below is my code in my jsp file
> inside the <head> section.
>
> <script type="text/javascript">
>     dwr.engine.setTextHtmlHandler(function() {
>         alert("Session time out!!!");
>     });
> </script>
>
> Then, inside my web.xml, I define my session time out for 1 minute.
>
> <session-config>
>     <session-timeout>1</session-timeout>
>   </session-config>
>
> After that, I start my tomcat 5.5 and access this jsp page.  Wait for very
> long, the setTextHtmlHandler function never call at all.  Is there
> something I had done wrong?
>
> Thanks,
> Teoh
>

--
View this message in context: http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
Sent from the DWR - Users mailing list archive at Nabble.com.


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



Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Apologies for resurrecting this old topic but I couldn't find straight answer neither elsewhere nor in this topic so far. Can someone please explain how come that adding e.g.

<script type="text/javascript">
    dwr.engine.setTextHtmlHandler(function() {
        document.location = 'login.htm';
    });
</script>

isn't enough in following case:
- Spring security filter chain is configured in web.xml before dwr servlet mapping to filter all requests (/*) so including requests to /dwr/*;
- after Spring security identifies that session has expired (so security context too), since it's been configured to enforce that only authenticated user of given role can make dwr calls, it responds with redirect to login page;
- thus request never makes it to the dwr servlet.

Question is how come that that redirect response isn't treated as candidate for handling by function assigned as dwr.engine.textHtmlHandler? Should some other handler method be overridden instead in this case?

Thanks in advance!

Regards,
Stevo.


XMaNIaC wrote:
Interesting post, just one consideration, in the end <dwr:global-filter />
was discarded and global filters are declared using the same syntax as local
ones (but outside a bean definition scope).

And that makes me wonder what happened to @GlobalFilter in the process..I
have to check and update the ticket

On Tue, Mar 31, 2009 at 7:18 PM, xeusman <xeus_man@yahoo.com> wrote:

>
>
> Try the following link, you need to write an ajax filter. And there is no
> need for setTextHtmlHandler, you can throw an exception as usual.
>
> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>
>
>
> tlteoh wrote:
> >
> > DWR Version:  v2.0.2
> > Tomcat: v5.5
> >
> > I had been searching in the internet long time and still can't find out
> > the usage of the setTextHtmlHandler.  Below is my code in my jsp file
> > inside the <head> section.
> >
> > <script type="text/javascript">
> >     dwr.engine.setTextHtmlHandler(function() {
> >         alert("Session time out!!!");
> >     });
> > </script>
> >
> > Then, inside my web.xml, I define my session time out for 1 minute.
> >
> > <session-config>
> >     <session-timeout>1</session-timeout>
> >   </session-config>
> >
> > After that, I start my tomcat 5.5 and access this jsp page.  Wait for
> very
> > long, the setTextHtmlHandler function never call at all.  Is there
> > something I had done wrong?
> >
> > Thanks,
> > Teoh
> >
>
> --
> View this message in context:
> http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: dwr.engine.setTextHtmlHandler not working

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First off, I believe there were some issues with setTextHtmlHandler in earlier versions of DWR 2.x.  So I would recommend updating to the latest release 2.0.5.

Secondly, if the filter is intercepting the request why don't you have the filter handle redirecting the user to the login page?

On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic <sslavic@...> wrote:

Apologies for resurrecting this old topic but I couldn't find straight answer
neither elsewhere nor in this topic so far. Can someone please explain how
come that adding e.g.

<script type="text/javascript">
   dwr.engine.setTextHtmlHandler(function() {
       document.location = 'login.htm';
   });
</script>

isn't enough in following case:
- Spring security filter chain is configured in web.xml before dwr servlet
mapping to filter all requests (/*) so including requests to /dwr/*;
- after Spring security identifies that session has expired (so security
context too), since it's been configured to enforce that only authenticated
user of given role can make dwr calls, it responds with redirect to login
page;
- thus request never makes it to the dwr servlet.

Question is how come that that redirect response isn't treated as candidate
for handling by function assigned as dwr.engine.textHtmlHandler? Should some
other handler method be overridden instead in this case?

Thanks in advance!

Regards,
Stevo.



XMaNIaC wrote:
>
> Interesting post, just one consideration, in the end <dwr:global-filter />
> was discarded and global filters are declared using the same syntax as
> local
> ones (but outside a bean definition scope).
>
> And that makes me wonder what happened to @GlobalFilter in the process..I
> have to check and update the ticket
>
> On Tue, Mar 31, 2009 at 7:18 PM, xeusman <xeus_man@...> wrote:
>
>>
>>
>> Try the following link, you need to write an ajax filter. And there is no
>> need for setTextHtmlHandler, you can throw an exception as usual.
>>
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>>
>>
>>
>> tlteoh wrote:
>> >
>> > DWR Version:  v2.0.2
>> > Tomcat: v5.5
>> >
>> > I had been searching in the internet long time and still can't find out
>> > the usage of the setTextHtmlHandler.  Below is my code in my jsp file
>> > inside the <head> section.
>> >
>> > <script type="text/javascript">
>> >     dwr.engine.setTextHtmlHandler(function() {
>> >         alert("Session time out!!!");
>> >     });
>> > </script>
>> >
>> > Then, inside my web.xml, I define my session time out for 1 minute.
>> >
>> > <session-config>
>> >     <session-timeout>1</session-timeout>
>> >   </session-config>
>> >
>> > After that, I start my tomcat 5.5 and access this jsp page.  Wait for
>> very
>> > long, the setTextHtmlHandler function never call at all.  Is there
>> > something I had done wrong?
>> >
>> > Thanks,
>> > Teoh
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
Sent from the DWR - Users mailing list archive at Nabble.com.


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



Re: dwr.engine.setTextHtmlHandler not working

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If the filter is redirecting to the login page why do you need setTextHtmlHandler?

On Tue, Oct 6, 2009 at 4:49 PM, David Marginian <david@...> wrote:
First off, I believe there were some issues with setTextHtmlHandler in earlier versions of DWR 2.x.  So I would recommend updating to the latest release 2.0.5.

Secondly, if the filter is intercepting the request why don't you have the filter handle redirecting the user to the login page?


On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic <sslavic@...> wrote:

Apologies for resurrecting this old topic but I couldn't find straight answer
neither elsewhere nor in this topic so far. Can someone please explain how
come that adding e.g.

<script type="text/javascript">
   dwr.engine.setTextHtmlHandler(function() {
       document.location = 'login.htm';
   });
</script>

isn't enough in following case:
- Spring security filter chain is configured in web.xml before dwr servlet
mapping to filter all requests (/*) so including requests to /dwr/*;
- after Spring security identifies that session has expired (so security
context too), since it's been configured to enforce that only authenticated
user of given role can make dwr calls, it responds with redirect to login
page;
- thus request never makes it to the dwr servlet.

Question is how come that that redirect response isn't treated as candidate
for handling by function assigned as dwr.engine.textHtmlHandler? Should some
other handler method be overridden instead in this case?

Thanks in advance!

Regards,
Stevo.



XMaNIaC wrote:
>
> Interesting post, just one consideration, in the end <dwr:global-filter />
> was discarded and global filters are declared using the same syntax as
> local
> ones (but outside a bean definition scope).
>
> And that makes me wonder what happened to @GlobalFilter in the process..I
> have to check and update the ticket
>
> On Tue, Mar 31, 2009 at 7:18 PM, xeusman <xeus_man@...> wrote:
>
>>
>>
>> Try the following link, you need to write an ajax filter. And there is no
>> need for setTextHtmlHandler, you can throw an exception as usual.
>>
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>>
>>
>>
>> tlteoh wrote:
>> >
>> > DWR Version:  v2.0.2
>> > Tomcat: v5.5
>> >
>> > I had been searching in the internet long time and still can't find out
>> > the usage of the setTextHtmlHandler.  Below is my code in my jsp file
>> > inside the <head> section.
>> >
>> > <script type="text/javascript">
>> >     dwr.engine.setTextHtmlHandler(function() {
>> >         alert("Session time out!!!");
>> >     });
>> > </script>
>> >
>> > Then, inside my web.xml, I define my session time out for 1 minute.
>> >
>> > <session-config>
>> >     <session-timeout>1</session-timeout>
>> >   </session-config>
>> >
>> > After that, I start my tomcat 5.5 and access this jsp page.  Wait for
>> very
>> > long, the setTextHtmlHandler function never call at all.  Is there
>> > something I had done wrong?
>> >
>> > Thanks,
>> > Teoh
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
Sent from the DWR - Users mailing list archive at Nabble.com.


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




Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was using dwr 2.0.3 since I'm using maven for dependency management and 2.0.3 is the most recent release on maven central repository. I knew there was 2.0.5 available on atlassian's public repository but I don't like adding 3rd party repositories if I really don't have to. Wish dwr releases were published on maven central as part of the release process. Nevertheless, I've just added atlassian public repo, will try how things work with 2.0.5.

Isn't dwr call response handled by dwr javascript and not directly by the browser? I assume if it was handled directly by the browser that it would result in actual redirect.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 12:55 AM, David Marginian <david@...> wrote:
If the filter is redirecting to the login page why do you need setTextHtmlHandler?


On Tue, Oct 6, 2009 at 4:49 PM, David Marginian <david@...> wrote:
First off, I believe there were some issues with setTextHtmlHandler in earlier versions of DWR 2.x.  So I would recommend updating to the latest release 2.0.5.

Secondly, if the filter is intercepting the request why don't you have the filter handle redirecting the user to the login page?


On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic <sslavic@...> wrote:

Apologies for resurrecting this old topic but I couldn't find straight answer
neither elsewhere nor in this topic so far. Can someone please explain how
come that adding e.g.

<script type="text/javascript">
   dwr.engine.setTextHtmlHandler(function() {
       document.location = 'login.htm';
   });
</script>

isn't enough in following case:
- Spring security filter chain is configured in web.xml before dwr servlet
mapping to filter all requests (/*) so including requests to /dwr/*;
- after Spring security identifies that session has expired (so security
context too), since it's been configured to enforce that only authenticated
user of given role can make dwr calls, it responds with redirect to login
page;
- thus request never makes it to the dwr servlet.

Question is how come that that redirect response isn't treated as candidate
for handling by function assigned as dwr.engine.textHtmlHandler? Should some
other handler method be overridden instead in this case?

Thanks in advance!

Regards,
Stevo.



XMaNIaC wrote:
>
> Interesting post, just one consideration, in the end <dwr:global-filter />
> was discarded and global filters are declared using the same syntax as
> local
> ones (but outside a bean definition scope).
>
> And that makes me wonder what happened to @GlobalFilter in the process..I
> have to check and update the ticket
>
> On Tue, Mar 31, 2009 at 7:18 PM, xeusman <xeus_man@...> wrote:
>
>>
>>
>> Try the following link, you need to write an ajax filter. And there is no
>> need for setTextHtmlHandler, you can throw an exception as usual.
>>
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>> http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>>
>>
>>
>> tlteoh wrote:
>> >
>> > DWR Version:  v2.0.2
>> > Tomcat: v5.5
>> >
>> > I had been searching in the internet long time and still can't find out
>> > the usage of the setTextHtmlHandler.  Below is my code in my jsp file
>> > inside the <head> section.
>> >
>> > <script type="text/javascript">
>> >     dwr.engine.setTextHtmlHandler(function() {
>> >         alert("Session time out!!!");
>> >     });
>> > </script>
>> >
>> > Then, inside my web.xml, I define my session time out for 1 minute.
>> >
>> > <session-config>
>> >     <session-timeout>1</session-timeout>
>> >   </session-config>
>> >
>> > After that, I start my tomcat 5.5 and access this jsp page.  Wait for
>> very
>> > long, the setTextHtmlHandler function never call at all.  Is there
>> > something I had done wrong?
>> >
>> > Thanks,
>> > Teoh
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
Sent from the DWR - Users mailing list archive at Nabble.com.


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





Re: dwr.engine.setTextHtmlHandler not working

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In order for the textHtmlHandler to be called the response has to have
content, the statusCode has to be 200, and the contentType of the
response has to be text/html. You can debug through engine.js using
firebug and quickly see where the problem is.

Stevo Slavić wrote:

> I was using dwr 2.0.3 since I'm using maven for dependency management
> and 2.0.3 is the most recent release on maven central repository. I
> knew there was 2.0.5 available on atlassian's public repository but I
> don't like adding 3rd party repositories if I really don't have to.
> Wish dwr releases were published on maven central as part of the
> release process. Nevertheless, I've just added atlassian public repo,
> will try how things work with 2.0.5.
>
> Isn't dwr call response handled by dwr javascript and not directly by
> the browser? I assume if it was handled directly by the browser that
> it would result in actual redirect.
>
> Regards,
> Stevo.
>
> On Wed, Oct 7, 2009 at 12:55 AM, David Marginian <david@...
> <mailto:david@...>> wrote:
>
>     If the filter is redirecting to the login page why do you need
>     setTextHtmlHandler?
>
>
>     On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
>     <david@... <mailto:david@...>> wrote:
>
>         First off, I believe there were some issues with
>         setTextHtmlHandler in earlier versions of DWR 2.x. So I would
>         recommend updating to the latest release 2.0.5.
>
>         Secondly, if the filter is intercepting the request why don't
>         you have the filter handle redirecting the user to the login
>         page?
>
>
>         On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
>         <sslavic@... <mailto:sslavic@...>> wrote:
>
>
>             Apologies for resurrecting this old topic but I couldn't
>             find straight answer
>             neither elsewhere nor in this topic so far. Can someone
>             please explain how
>             come that adding e.g.
>
>             <script type="text/javascript">
>             dwr.engine.setTextHtmlHandler(function() {
>             document.location = 'login.htm';
>             });
>             </script>
>
>             isn't enough in following case:
>             - Spring security filter chain is configured in web.xml
>             before dwr servlet
>             mapping to filter all requests (/*) so including requests
>             to /dwr/*;
>             - after Spring security identifies that session has
>             expired (so security
>             context too), since it's been configured to enforce that
>             only authenticated
>             user of given role can make dwr calls, it responds with
>             redirect to login
>             page;
>             - thus request never makes it to the dwr servlet.
>
>             Question is how come that that redirect response isn't
>             treated as candidate
>             for handling by function assigned as
>             dwr.engine.textHtmlHandler? Should some
>             other handler method be overridden instead in this case?
>
>             Thanks in advance!
>
>             Regards,
>             Stevo.
>
>
>
>             XMaNIaC wrote:
>             >
>             > Interesting post, just one consideration, in the end
>             <dwr:global-filter />
>             > was discarded and global filters are declared using the
>             same syntax as
>             > local
>             > ones (but outside a bean definition scope).
>             >
>             > And that makes me wonder what happened to @GlobalFilter
>             in the process..I
>             > have to check and update the ticket
>             >
>             > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
>             <xeus_man@... <mailto:xeus_man@...>> wrote:
>             >
>             >>
>             >>
>             >> Try the following link, you need to write an ajax
>             filter. And there is no
>             >> need for setTextHtmlHandler, you can throw an exception
>             as usual.
>             >>
>             >>
>             http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>             >>
>             http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>             >>
>             >>
>             >>
>             >> tlteoh wrote:
>             >> >
>             >> > DWR Version: v2.0.2
>             >> > Tomcat: v5.5
>             >> >
>             >> > I had been searching in the internet long time and
>             still can't find out
>             >> > the usage of the setTextHtmlHandler. Below is my code
>             in my jsp file
>             >> > inside the <head> section.
>             >> >
>             >> > <script type="text/javascript">
>             >> > dwr.engine.setTextHtmlHandler(function() {
>             >> > alert("Session time out!!!");
>             >> > });
>             >> > </script>
>             >> >
>             >> > Then, inside my web.xml, I define my session time out
>             for 1 minute.
>             >> >
>             >> > <session-config>
>             >> > <session-timeout>1</session-timeout>
>             >> > </session-config>
>             >> >
>             >> > After that, I start my tomcat 5.5 and access this jsp
>             page. Wait for
>             >> very
>             >> > long, the setTextHtmlHandler function never call at
>             all. Is there
>             >> > something I had done wrong?
>             >> >
>             >> > Thanks,
>             >> > Teoh
>             >> >
>             >>
>             >> --
>             >> View this message in context:
>             >>
>             http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
>             >> Sent from the DWR - Users mailing list archive at
>             Nabble.com.
>             >>
>             >>
>             >>
>             ---------------------------------------------------------------------
>             >> To unsubscribe, e-mail:
>             users-unsubscribe@...
>             <mailto:users-unsubscribe@...>
>             >> For additional commands, e-mail:
>             users-help@...
>             <mailto:users-help@...>
>             >>
>             >>
>             >
>             >
>
>             --
>             View this message in context:
>             http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
>             Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
>             ---------------------------------------------------------------------
>             To unsubscribe, e-mail: users-unsubscribe@...
>             <mailto:users-unsubscribe@...>
>             For additional commands, e-mail:
>             users-help@...
>             <mailto:users-help@...>
>
>
>
>



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4484 (20091006) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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


Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Using 2.0.5 didn't change anything. For redirect statusCode is 302 so textHtmlHandler won't get called, but something else does seem to be called. Can not debug javascript at the moment, Firebug doesn't seem to work with FF 3.5.3, so I went to use Temper Data FF addon, and it interestingly logged dwr method call POST request, redirect to login page response, and then GET request to correct login form URL (which I'm not yet sure what triggered) and 200 OK response to that GET - problem is that the browser URL doesn't change nor anything else happens with current page content, as if there was no login page URL request/response. I assume that dwr's javascript somehow makes that mysterious request to login page as response to redirect response it receives, it (dwr) receives login page content response (that second logged response, with 200 OK status) and doesn't do anything with it.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 2:14 AM, David Marginian <david@...> wrote:
In order for the textHtmlHandler to be called the response has to have content, the statusCode has to be 200, and the contentType of the response has to be text/html. You can debug through engine.js using firebug and quickly see where the problem is.

Stevo Slavić wrote:
I was using dwr 2.0.3 since I'm using maven for dependency management and 2.0.3 is the most recent release on maven central repository. I knew there was 2.0.5 available on atlassian's public repository but I don't like adding 3rd party repositories if I really don't have to. Wish dwr releases were published on maven central as part of the release process. Nevertheless, I've just added atlassian public repo, will try how things work with 2.0.5.

Isn't dwr call response handled by dwr javascript and not directly by the browser? I assume if it was handled directly by the browser that it would result in actual redirect.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 12:55 AM, David Marginian <david@... <mailto:david@...>> wrote:

   If the filter is redirecting to the login page why do you need
   setTextHtmlHandler?


   On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
   <david@... <mailto:david@...>> wrote:

       First off, I believe there were some issues with
       setTextHtmlHandler in earlier versions of DWR 2.x. So I would
       recommend updating to the latest release 2.0.5.

       Secondly, if the filter is intercepting the request why don't
       you have the filter handle redirecting the user to the login
       page?


       On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
       <sslavic@... <mailto:sslavic@...>> wrote:


           Apologies for resurrecting this old topic but I couldn't
           find straight answer
           neither elsewhere nor in this topic so far. Can someone
           please explain how
           come that adding e.g.

           <script type="text/javascript">
           dwr.engine.setTextHtmlHandler(function() {
           document.location = 'login.htm';
           });
           </script>

           isn't enough in following case:
           - Spring security filter chain is configured in web.xml
           before dwr servlet
           mapping to filter all requests (/*) so including requests
           to /dwr/*;
           - after Spring security identifies that session has
           expired (so security
           context too), since it's been configured to enforce that
           only authenticated
           user of given role can make dwr calls, it responds with
           redirect to login
           page;
           - thus request never makes it to the dwr servlet.

           Question is how come that that redirect response isn't
           treated as candidate
           for handling by function assigned as
           dwr.engine.textHtmlHandler? Should some
           other handler method be overridden instead in this case?

           Thanks in advance!

           Regards,
           Stevo.



           XMaNIaC wrote:
           >
           > Interesting post, just one consideration, in the end
           <dwr:global-filter />
           > was discarded and global filters are declared using the
           same syntax as
           > local
           > ones (but outside a bean definition scope).
           >
           > And that makes me wonder what happened to @GlobalFilter
           in the process..I
           > have to check and update the ticket
           >
           > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
           <xeus_man@... <mailto:xeus_man@...>> wrote:
           >
           >>
           >>
           >> Try the following link, you need to write an ajax
           filter. And there is no
           >> need for setTextHtmlHandler, you can throw an exception
           as usual.
           >>
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           >>
           >>
           >> tlteoh wrote:
           >> >
           >> > DWR Version: v2.0.2
           >> > Tomcat: v5.5
           >> >
           >> > I had been searching in the internet long time and
           still can't find out
           >> > the usage of the setTextHtmlHandler. Below is my code
           in my jsp file
           >> > inside the <head> section.
           >> >
           >> > <script type="text/javascript">
           >> > dwr.engine.setTextHtmlHandler(function() {
           >> > alert("Session time out!!!");
           >> > });
           >> > </script>
           >> >
           >> > Then, inside my web.xml, I define my session time out
           for 1 minute.
           >> >
           >> > <session-config>
           >> > <session-timeout>1</session-timeout>
           >> > </session-config>
           >> >
           >> > After that, I start my tomcat 5.5 and access this jsp
           page. Wait for
           >> very
           >> > long, the setTextHtmlHandler function never call at
           all. Is there
           >> > something I had done wrong?
           >> >
           >> > Thanks,
           >> > Teoh
           >> >
           >>
           >> --
           >> View this message in context:
           >>
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
           >> Sent from the DWR - Users mailing list archive at
           Nabble.com.
           >>
           >>
           >>
           ---------------------------------------------------------------------
           >> To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           >> For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>

           >>
           >>
           >
           >

           --
           View this message in context:
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
           Sent from the DWR - Users mailing list archive at Nabble.com.


           ---------------------------------------------------------------------
           To unsubscribe, e-mail: users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>







__________ Information from ESET NOD32 Antivirus, version of virus signature database 4484 (20091006) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




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



Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Debugged on Safari, it seems I'm hit by http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix version(s) I guess there won't be dwr 2.0.6 release

Regards,
Stevo.

On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@...> wrote:
Using 2.0.5 didn't change anything. For redirect statusCode is 302 so textHtmlHandler won't get called, but something else does seem to be called. Can not debug javascript at the moment, Firebug doesn't seem to work with FF 3.5.3, so I went to use Temper Data FF addon, and it interestingly logged dwr method call POST request, redirect to login page response, and then GET request to correct login form URL (which I'm not yet sure what triggered) and 200 OK response to that GET - problem is that the browser URL doesn't change nor anything else happens with current page content, as if there was no login page URL request/response. I assume that dwr's javascript somehow makes that mysterious request to login page as response to redirect response it receives, it (dwr) receives login page content response (that second logged response, with 200 OK status) and doesn't do anything with it.

Regards,
Stevo.


On Wed, Oct 7, 2009 at 2:14 AM, David Marginian <david@...> wrote:
In order for the textHtmlHandler to be called the response has to have content, the statusCode has to be 200, and the contentType of the response has to be text/html. You can debug through engine.js using firebug and quickly see where the problem is.

Stevo Slavić wrote:
I was using dwr 2.0.3 since I'm using maven for dependency management and 2.0.3 is the most recent release on maven central repository. I knew there was 2.0.5 available on atlassian's public repository but I don't like adding 3rd party repositories if I really don't have to. Wish dwr releases were published on maven central as part of the release process. Nevertheless, I've just added atlassian public repo, will try how things work with 2.0.5.

Isn't dwr call response handled by dwr javascript and not directly by the browser? I assume if it was handled directly by the browser that it would result in actual redirect.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 12:55 AM, David Marginian <david@... <mailto:david@...>> wrote:

   If the filter is redirecting to the login page why do you need
   setTextHtmlHandler?


   On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
   <david@... <mailto:david@...>> wrote:

       First off, I believe there were some issues with
       setTextHtmlHandler in earlier versions of DWR 2.x. So I would
       recommend updating to the latest release 2.0.5.

       Secondly, if the filter is intercepting the request why don't
       you have the filter handle redirecting the user to the login
       page?


       On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
       <sslavic@... <mailto:sslavic@...>> wrote:


           Apologies for resurrecting this old topic but I couldn't
           find straight answer
           neither elsewhere nor in this topic so far. Can someone
           please explain how
           come that adding e.g.

           <script type="text/javascript">
           dwr.engine.setTextHtmlHandler(function() {
           document.location = 'login.htm';
           });
           </script>

           isn't enough in following case:
           - Spring security filter chain is configured in web.xml
           before dwr servlet
           mapping to filter all requests (/*) so including requests
           to /dwr/*;
           - after Spring security identifies that session has
           expired (so security
           context too), since it's been configured to enforce that
           only authenticated
           user of given role can make dwr calls, it responds with
           redirect to login
           page;
           - thus request never makes it to the dwr servlet.

           Question is how come that that redirect response isn't
           treated as candidate
           for handling by function assigned as
           dwr.engine.textHtmlHandler? Should some
           other handler method be overridden instead in this case?

           Thanks in advance!

           Regards,
           Stevo.



           XMaNIaC wrote:
           >
           > Interesting post, just one consideration, in the end
           <dwr:global-filter />
           > was discarded and global filters are declared using the
           same syntax as
           > local
           > ones (but outside a bean definition scope).
           >
           > And that makes me wonder what happened to @GlobalFilter
           in the process..I
           > have to check and update the ticket
           >
           > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
           <xeus_man@... <mailto:xeus_man@...>> wrote:
           >
           >>
           >>
           >> Try the following link, you need to write an ajax
           filter. And there is no
           >> need for setTextHtmlHandler, you can throw an exception
           as usual.
           >>
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           >>
           >>
           >> tlteoh wrote:
           >> >
           >> > DWR Version: v2.0.2
           >> > Tomcat: v5.5
           >> >
           >> > I had been searching in the internet long time and
           still can't find out
           >> > the usage of the setTextHtmlHandler. Below is my code
           in my jsp file
           >> > inside the <head> section.
           >> >
           >> > <script type="text/javascript">
           >> > dwr.engine.setTextHtmlHandler(function() {
           >> > alert("Session time out!!!");
           >> > });
           >> > </script>
           >> >
           >> > Then, inside my web.xml, I define my session time out
           for 1 minute.
           >> >
           >> > <session-config>
           >> > <session-timeout>1</session-timeout>
           >> > </session-config>
           >> >
           >> > After that, I start my tomcat 5.5 and access this jsp
           page. Wait for
           >> very
           >> > long, the setTextHtmlHandler function never call at
           all. Is there
           >> > something I had done wrong?
           >> >
           >> > Thanks,
           >> > Teoh
           >> >
           >>
           >> --
           >> View this message in context:
           >>
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
           >> Sent from the DWR - Users mailing list archive at
           Nabble.com.
           >>
           >>
           >>
           ---------------------------------------------------------------------
           >> To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           >> For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>

           >>
           >>
           >
           >

           --
           View this message in context:
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
           Sent from the DWR - Users mailing list archive at Nabble.com.


           ---------------------------------------------------------------------
           To unsubscribe, e-mail: users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>







__________ Information from ESET NOD32 Antivirus, version of virus signature database 4484 (20091006) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




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




Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, it was that bug. Using custom warning handler like:

<script type='text/javascript'>
    dwr.engine.setWarningHandler(function(message, ex) {
        if (ex.name == 'dwr.engine.missingData') {
            document.location = '<c:url value="/login.htm" />';
        }
    });
</script>

as a workaround did it for me.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 3:16 AM, Stevo Slavić <sslavic@...> wrote:
Debugged on Safari, it seems I'm hit by http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix version(s) I guess there won't be dwr 2.0.6 release

Regards,
Stevo.


On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@...> wrote:
Using 2.0.5 didn't change anything. For redirect statusCode is 302 so textHtmlHandler won't get called, but something else does seem to be called. Can not debug javascript at the moment, Firebug doesn't seem to work with FF 3.5.3, so I went to use Temper Data FF addon, and it interestingly logged dwr method call POST request, redirect to login page response, and then GET request to correct login form URL (which I'm not yet sure what triggered) and 200 OK response to that GET - problem is that the browser URL doesn't change nor anything else happens with current page content, as if there was no login page URL request/response. I assume that dwr's javascript somehow makes that mysterious request to login page as response to redirect response it receives, it (dwr) receives login page content response (that second logged response, with 200 OK status) and doesn't do anything with it.

Regards,
Stevo.


On Wed, Oct 7, 2009 at 2:14 AM, David Marginian <david@...> wrote:
In order for the textHtmlHandler to be called the response has to have content, the statusCode has to be 200, and the contentType of the response has to be text/html. You can debug through engine.js using firebug and quickly see where the problem is.

Stevo Slavić wrote:
I was using dwr 2.0.3 since I'm using maven for dependency management and 2.0.3 is the most recent release on maven central repository. I knew there was 2.0.5 available on atlassian's public repository but I don't like adding 3rd party repositories if I really don't have to. Wish dwr releases were published on maven central as part of the release process. Nevertheless, I've just added atlassian public repo, will try how things work with 2.0.5.

Isn't dwr call response handled by dwr javascript and not directly by the browser? I assume if it was handled directly by the browser that it would result in actual redirect.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 12:55 AM, David Marginian <david@... <mailto:david@...>> wrote:

   If the filter is redirecting to the login page why do you need
   setTextHtmlHandler?


   On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
   <david@... <mailto:david@...>> wrote:

       First off, I believe there were some issues with
       setTextHtmlHandler in earlier versions of DWR 2.x. So I would
       recommend updating to the latest release 2.0.5.

       Secondly, if the filter is intercepting the request why don't
       you have the filter handle redirecting the user to the login
       page?


       On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
       <sslavic@... <mailto:sslavic@...>> wrote:


           Apologies for resurrecting this old topic but I couldn't
           find straight answer
           neither elsewhere nor in this topic so far. Can someone
           please explain how
           come that adding e.g.

           <script type="text/javascript">
           dwr.engine.setTextHtmlHandler(function() {
           document.location = 'login.htm';
           });
           </script>

           isn't enough in following case:
           - Spring security filter chain is configured in web.xml
           before dwr servlet
           mapping to filter all requests (/*) so including requests
           to /dwr/*;
           - after Spring security identifies that session has
           expired (so security
           context too), since it's been configured to enforce that
           only authenticated
           user of given role can make dwr calls, it responds with
           redirect to login
           page;
           - thus request never makes it to the dwr servlet.

           Question is how come that that redirect response isn't
           treated as candidate
           for handling by function assigned as
           dwr.engine.textHtmlHandler? Should some
           other handler method be overridden instead in this case?

           Thanks in advance!

           Regards,
           Stevo.



           XMaNIaC wrote:
           >
           > Interesting post, just one consideration, in the end
           <dwr:global-filter />
           > was discarded and global filters are declared using the
           same syntax as
           > local
           > ones (but outside a bean definition scope).
           >
           > And that makes me wonder what happened to @GlobalFilter
           in the process..I
           > have to check and update the ticket
           >
           > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
           <xeus_man@... <mailto:xeus_man@...>> wrote:
           >
           >>
           >>
           >> Try the following link, you need to write an ajax
           filter. And there is no
           >> need for setTextHtmlHandler, you can throw an exception
           as usual.
           >>
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
           >>
           >>
           >>
           >> tlteoh wrote:
           >> >
           >> > DWR Version: v2.0.2
           >> > Tomcat: v5.5
           >> >
           >> > I had been searching in the internet long time and
           still can't find out
           >> > the usage of the setTextHtmlHandler. Below is my code
           in my jsp file
           >> > inside the <head> section.
           >> >
           >> > <script type="text/javascript">
           >> > dwr.engine.setTextHtmlHandler(function() {
           >> > alert("Session time out!!!");
           >> > });
           >> > </script>
           >> >
           >> > Then, inside my web.xml, I define my session time out
           for 1 minute.
           >> >
           >> > <session-config>
           >> > <session-timeout>1</session-timeout>
           >> > </session-config>
           >> >
           >> > After that, I start my tomcat 5.5 and access this jsp
           page. Wait for
           >> very
           >> > long, the setTextHtmlHandler function never call at
           all. Is there
           >> > something I had done wrong?
           >> >
           >> > Thanks,
           >> > Teoh
           >> >
           >>
           >> --
           >> View this message in context:
           >>
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
           >> Sent from the DWR - Users mailing list archive at
           Nabble.com.
           >>
           >>
           >>
           ---------------------------------------------------------------------
           >> To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           >> For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>

           >>
           >>
           >
           >

           --
           View this message in context:
           http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
           Sent from the DWR - Users mailing list archive at Nabble.com.


           ---------------------------------------------------------------------
           To unsubscribe, e-mail: users-unsubscribe@...
           <mailto:users-unsubscribe@...>

           For additional commands, e-mail:
           users-help@...
           <mailto:users-help@...>







__________ Information from ESET NOD32 Antivirus, version of virus signature database 4484 (20091006) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




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





Re: dwr.engine.setTextHtmlHandler not working

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We have been talking about it, but this fix is in trunk - we will have
to merge it down.  I would recommend using the warningHandler because it
may be awhile if we do push out a 2.0.6.

Stevo Slavić wrote:

> Debugged on Safari, it seems I'm hit by
> http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix
> version(s) I guess there won't be dwr 2.0.6 release
>
> Regards,
> Stevo.
>
> On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@...
> <mailto:sslavic@...>> wrote:
>
>     Using 2.0.5 didn't change anything. For redirect statusCode is 302
>     so textHtmlHandler won't get called, but something else does seem
>     to be called. Can not debug javascript at the moment, Firebug
>     doesn't seem to work with FF 3.5.3, so I went to use Temper Data
>     FF addon, and it interestingly logged dwr method call POST
>     request, redirect to login page response, and then GET request to
>     correct login form URL (which I'm not yet sure what triggered) and
>     200 OK response to that GET - problem is that the browser URL
>     doesn't change nor anything else happens with current page
>     content, as if there was no login page URL request/response. I
>     assume that dwr's javascript somehow makes that mysterious request
>     to login page as response to redirect response it receives, it
>     (dwr) receives login page content response (that second logged
>     response, with 200 OK status) and doesn't do anything with it.
>
>     Regards,
>     Stevo.
>
>
>     On Wed, Oct 7, 2009 at 2:14 AM, David Marginian
>     <david@... <mailto:david@...>> wrote:
>
>         In order for the textHtmlHandler to be called the response has
>         to have content, the statusCode has to be 200, and the
>         contentType of the response has to be text/html. You can debug
>         through engine.js using firebug and quickly see where the
>         problem is.
>
>         Stevo Slavić wrote:
>
>             I was using dwr 2.0.3 since I'm using maven for dependency
>             management and 2.0.3 is the most recent release on maven
>             central repository. I knew there was 2.0.5 available on
>             atlassian's public repository but I don't like adding 3rd
>             party repositories if I really don't have to. Wish dwr
>             releases were published on maven central as part of the
>             release process. Nevertheless, I've just added atlassian
>             public repo, will try how things work with 2.0.5.
>
>             Isn't dwr call response handled by dwr javascript and not
>             directly by the browser? I assume if it was handled
>             directly by the browser that it would result in actual
>             redirect.
>
>             Regards,
>             Stevo.
>
>             On Wed, Oct 7, 2009 at 12:55 AM, David Marginian
>             <david@... <mailto:david@...>
>             <mailto:david@... <mailto:david@...>>>
>             wrote:
>
>                If the filter is redirecting to the login page why do
>             you need
>                setTextHtmlHandler?
>
>
>                On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
>                <david@... <mailto:david@...>
>             <mailto:david@... <mailto:david@...>>>
>             wrote:
>
>                    First off, I believe there were some issues with
>                    setTextHtmlHandler in earlier versions of DWR 2.x.
>             So I would
>                    recommend updating to the latest release 2.0.5.
>
>                    Secondly, if the filter is intercepting the request
>             why don't
>                    you have the filter handle redirecting the user to
>             the login
>                    page?
>
>
>                    On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
>                    <sslavic@... <mailto:sslavic@...>
>             <mailto:sslavic@... <mailto:sslavic@...>>> wrote:
>
>
>                        Apologies for resurrecting this old topic but I
>             couldn't
>                        find straight answer
>                        neither elsewhere nor in this topic so far. Can
>             someone
>                        please explain how
>                        come that adding e.g.
>
>                        <script type="text/javascript">
>                        dwr.engine.setTextHtmlHandler(function() {
>                        document.location = 'login.htm';
>                        });
>                        </script>
>
>                        isn't enough in following case:
>                        - Spring security filter chain is configured in
>             web.xml
>                        before dwr servlet
>                        mapping to filter all requests (/*) so
>             including requests
>                        to /dwr/*;
>                        - after Spring security identifies that session has
>                        expired (so security
>                        context too), since it's been configured to
>             enforce that
>                        only authenticated
>                        user of given role can make dwr calls, it
>             responds with
>                        redirect to login
>                        page;
>                        - thus request never makes it to the dwr servlet.
>
>                        Question is how come that that redirect
>             response isn't
>                        treated as candidate
>                        for handling by function assigned as
>                        dwr.engine.textHtmlHandler? Should some
>                        other handler method be overridden instead in
>             this case?
>
>                        Thanks in advance!
>
>                        Regards,
>                        Stevo.
>
>
>
>                        XMaNIaC wrote:
>                        >
>                        > Interesting post, just one consideration, in
>             the end
>                        <dwr:global-filter />
>                        > was discarded and global filters are declared
>             using the
>                        same syntax as
>                        > local
>                        > ones (but outside a bean definition scope).
>                        >
>                        > And that makes me wonder what happened to
>             @GlobalFilter
>                        in the process..I
>                        > have to check and update the ticket
>                        >
>                        > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
>                        <xeus_man@... <mailto:xeus_man@...>
>             <mailto:xeus_man@... <mailto:xeus_man@...>>>
>             wrote:
>                        >
>                        >>
>                        >>
>                        >> Try the following link, you need to write an
>             ajax
>                        filter. And there is no
>                        >> need for setTextHtmlHandler, you can throw
>             an exception
>                        as usual.
>                        >>
>                        >>
>                      
>              http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>                        >>
>                      
>              http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
>                        >>
>                        >>
>                        >>
>                        >> tlteoh wrote:
>                        >> >
>                        >> > DWR Version: v2.0.2
>                        >> > Tomcat: v5.5
>                        >> >
>                        >> > I had been searching in the internet long
>             time and
>                        still can't find out
>                        >> > the usage of the setTextHtmlHandler. Below
>             is my code
>                        in my jsp file
>                        >> > inside the <head> section.
>                        >> >
>                        >> > <script type="text/javascript">
>                        >> > dwr.engine.setTextHtmlHandler(function() {
>                        >> > alert("Session time out!!!");
>                        >> > });
>                        >> > </script>
>                        >> >
>                        >> > Then, inside my web.xml, I define my
>             session time out
>                        for 1 minute.
>                        >> >
>                        >> > <session-config>
>                        >> > <session-timeout>1</session-timeout>
>                        >> > </session-config>
>                        >> >
>                        >> > After that, I start my tomcat 5.5 and
>             access this jsp
>                        page. Wait for
>                        >> very
>                        >> > long, the setTextHtmlHandler function
>             never call at
>                        all. Is there
>                        >> > something I had done wrong?
>                        >> >
>                        >> > Thanks,
>                        >> > Teoh
>                        >> >
>                        >>
>                        >> --
>                        >> View this message in context:
>                        >>
>                      
>              http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
>                        >> Sent from the DWR - Users mailing list
>             archive at
>                        Nabble.com.
>                        >>
>                        >>
>                        >>
>                      
>              ---------------------------------------------------------------------
>                        >> To unsubscribe, e-mail:
>                        users-unsubscribe@...
>             <mailto:users-unsubscribe@...>
>                        <mailto:users-unsubscribe@...
>             <mailto:users-unsubscribe@...>>
>
>                        >> For additional commands, e-mail:
>                        users-help@...
>             <mailto:users-help@...>
>                        <mailto:users-help@...
>             <mailto:users-help@...>>
>
>                        >>
>                        >>
>                        >
>                        >
>
>                        --
>                        View this message in context:
>                      
>              http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
>                        Sent from the DWR - Users mailing list archive
>             at Nabble.com.
>
>
>                      
>              ---------------------------------------------------------------------
>                        To unsubscribe, e-mail:
>             users-unsubscribe@...
>             <mailto:users-unsubscribe@...>
>                        <mailto:users-unsubscribe@...
>             <mailto:users-unsubscribe@...>>
>
>                        For additional commands, e-mail:
>                        users-help@...
>             <mailto:users-help@...>
>                        <mailto:users-help@...
>             <mailto:users-help@...>>
>
>
>
>
>
>
>
>         __________ Information from ESET NOD32 Antivirus, version of
>         virus signature database 4484 (20091006) __________
>
>         The message was checked by ESET NOD32 Antivirus.
>
>         http://www.eset.com
>
>
>
>
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: users-unsubscribe@...
>         <mailto:users-unsubscribe@...>
>         For additional commands, e-mail: users-help@...
>         <mailto:users-help@...>
>
>
>



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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


Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Will, with this bug fix, DWR handle redirect response using textHtmlHandler or is additional improvement request needed?

Regards,
Stevo.

On Wed, Oct 7, 2009 at 3:45 AM, David Marginian <david@...> wrote:
We have been talking about it, but this fix is in trunk - we will have to merge it down.  I would recommend using the warningHandler because it may be awhile if we do push out a 2.0.6.

Stevo Slavić wrote:
Debugged on Safari, it seems I'm hit by http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix version(s) I guess there won't be dwr 2.0.6 release

Regards,
Stevo.

On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@... <mailto:sslavic@...>> wrote:

   Using 2.0.5 didn't change anything. For redirect statusCode is 302
   so textHtmlHandler won't get called, but something else does seem
   to be called. Can not debug javascript at the moment, Firebug
   doesn't seem to work with FF 3.5.3, so I went to use Temper Data
   FF addon, and it interestingly logged dwr method call POST
   request, redirect to login page response, and then GET request to
   correct login form URL (which I'm not yet sure what triggered) and
   200 OK response to that GET - problem is that the browser URL
   doesn't change nor anything else happens with current page
   content, as if there was no login page URL request/response. I
   assume that dwr's javascript somehow makes that mysterious request
   to login page as response to redirect response it receives, it
   (dwr) receives login page content response (that second logged
   response, with 200 OK status) and doesn't do anything with it.

   Regards,
   Stevo.


   On Wed, Oct 7, 2009 at 2:14 AM, David Marginian
   <david@... <mailto:david@...>> wrote:

       In order for the textHtmlHandler to be called the response has
       to have content, the statusCode has to be 200, and the
       contentType of the response has to be text/html. You can debug
       through engine.js using firebug and quickly see where the
       problem is.

       Stevo Slavić wrote:

           I was using dwr 2.0.3 since I'm using maven for dependency
           management and 2.0.3 is the most recent release on maven
           central repository. I knew there was 2.0.5 available on
           atlassian's public repository but I don't like adding 3rd
           party repositories if I really don't have to. Wish dwr
           releases were published on maven central as part of the
           release process. Nevertheless, I've just added atlassian
           public repo, will try how things work with 2.0.5.

           Isn't dwr call response handled by dwr javascript and not
           directly by the browser? I assume if it was handled
           directly by the browser that it would result in actual
           redirect.

           Regards,
           Stevo.

           On Wed, Oct 7, 2009 at 12:55 AM, David Marginian
           <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

              If the filter is redirecting to the login page why do
           you need
              setTextHtmlHandler?


              On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
              <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

                  First off, I believe there were some issues with
                  setTextHtmlHandler in earlier versions of DWR 2.x.
           So I would
                  recommend updating to the latest release 2.0.5.

                  Secondly, if the filter is intercepting the request
           why don't
                  you have the filter handle redirecting the user to
           the login
                  page?


                  On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
                  <sslavic@... <mailto:sslavic@...>
           <mailto:sslavic@... <mailto:sslavic@...>>> wrote:


                      Apologies for resurrecting this old topic but I
           couldn't
                      find straight answer
                      neither elsewhere nor in this topic so far. Can
           someone
                      please explain how
                      come that adding e.g.

                      <script type="text/javascript">
                      dwr.engine.setTextHtmlHandler(function() {
                      document.location = 'login.htm';
                      });
                      </script>

                      isn't enough in following case:
                      - Spring security filter chain is configured in
           web.xml
                      before dwr servlet
                      mapping to filter all requests (/*) so
           including requests
                      to /dwr/*;
                      - after Spring security identifies that session has
                      expired (so security
                      context too), since it's been configured to
           enforce that
                      only authenticated
                      user of given role can make dwr calls, it
           responds with
                      redirect to login
                      page;
                      - thus request never makes it to the dwr servlet.

                      Question is how come that that redirect
           response isn't
                      treated as candidate
                      for handling by function assigned as
                      dwr.engine.textHtmlHandler? Should some
                      other handler method be overridden instead in
           this case?

                      Thanks in advance!

                      Regards,
                      Stevo.



                      XMaNIaC wrote:
                      >
                      > Interesting post, just one consideration, in
           the end
                      <dwr:global-filter />
                      > was discarded and global filters are declared
           using the
                      same syntax as
                      > local
                      > ones (but outside a bean definition scope).
                      >
                      > And that makes me wonder what happened to
           @GlobalFilter
                      in the process..I
                      > have to check and update the ticket
                      >
                      > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
                      <xeus_man@... <mailto:xeus_man@...>
           <mailto:xeus_man@... <mailto:xeus_man@...>>>

           wrote:
                      >
                      >>
                      >>
                      >> Try the following link, you need to write an
           ajax
                      filter. And there is no
                      >> need for setTextHtmlHandler, you can throw
           an exception
                      as usual.
                      >>
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                      >>
                      >>
                      >> tlteoh wrote:
                      >> >
                      >> > DWR Version: v2.0.2
                      >> > Tomcat: v5.5
                      >> >
                      >> > I had been searching in the internet long
           time and
                      still can't find out
                      >> > the usage of the setTextHtmlHandler. Below
           is my code
                      in my jsp file
                      >> > inside the <head> section.
                      >> >
                      >> > <script type="text/javascript">
                      >> > dwr.engine.setTextHtmlHandler(function() {
                      >> > alert("Session time out!!!");
                      >> > });
                      >> > </script>
                      >> >
                      >> > Then, inside my web.xml, I define my
           session time out
                      for 1 minute.
                      >> >
                      >> > <session-config>
                      >> > <session-timeout>1</session-timeout>
                      >> > </session-config>
                      >> >
                      >> > After that, I start my tomcat 5.5 and
           access this jsp
                      page. Wait for
                      >> very
                      >> > long, the setTextHtmlHandler function
           never call at
                      all. Is there
                      >> > something I had done wrong?
                      >> >
                      >> > Thanks,
                      >> > Teoh
                      >> >
                      >>
                      >> --
                      >> View this message in context:
                      >>
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
                      >> Sent from the DWR - Users mailing list
           archive at
                      Nabble.com.
                      >>
                      >>
                      >>
                                ---------------------------------------------------------------------
                      >> To unsubscribe, e-mail:
                      users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      >> For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>

                      >>
                      >>
                      >
                      >

                      --
                      View this message in context:
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
                      Sent from the DWR - Users mailing list archive
           at Nabble.com.


                                ---------------------------------------------------------------------
                      To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>







       __________ Information from ESET NOD32 Antivirus, version of
       virus signature database 4484 (20091006) __________

       The message was checked by ESET NOD32 Antivirus.

       http://www.eset.com




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






__________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________


The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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



Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Since it was said that only 200 OK response with non empty content is handled via textHtmlHandler, answer is then surely that 302 redirect will not get handled by textHtmlHandler even after release with fix to DWR-337 is made. I'll create a feature request. I guess it will be better if an additional, redirectHandler, is added so that if one needs special handling of redirects (different than with textHtmlHandler) it would be possible, while one could assign same handler function for both handlers if same behavior is needed.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 9:05 AM, Stevo Slavić <sslavic@...> wrote:
Will, with this bug fix, DWR handle redirect response using textHtmlHandler or is additional improvement request needed?

Regards,
Stevo.


On Wed, Oct 7, 2009 at 3:45 AM, David Marginian <david@...> wrote:
We have been talking about it, but this fix is in trunk - we will have to merge it down.  I would recommend using the warningHandler because it may be awhile if we do push out a 2.0.6.

Stevo Slavić wrote:
Debugged on Safari, it seems I'm hit by http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix version(s) I guess there won't be dwr 2.0.6 release

Regards,
Stevo.

On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@... <mailto:sslavic@...>> wrote:

   Using 2.0.5 didn't change anything. For redirect statusCode is 302
   so textHtmlHandler won't get called, but something else does seem
   to be called. Can not debug javascript at the moment, Firebug
   doesn't seem to work with FF 3.5.3, so I went to use Temper Data
   FF addon, and it interestingly logged dwr method call POST
   request, redirect to login page response, and then GET request to
   correct login form URL (which I'm not yet sure what triggered) and
   200 OK response to that GET - problem is that the browser URL
   doesn't change nor anything else happens with current page
   content, as if there was no login page URL request/response. I
   assume that dwr's javascript somehow makes that mysterious request
   to login page as response to redirect response it receives, it
   (dwr) receives login page content response (that second logged
   response, with 200 OK status) and doesn't do anything with it.

   Regards,
   Stevo.


   On Wed, Oct 7, 2009 at 2:14 AM, David Marginian
   <david@... <mailto:david@...>> wrote:

       In order for the textHtmlHandler to be called the response has
       to have content, the statusCode has to be 200, and the
       contentType of the response has to be text/html. You can debug
       through engine.js using firebug and quickly see where the
       problem is.

       Stevo Slavić wrote:

           I was using dwr 2.0.3 since I'm using maven for dependency
           management and 2.0.3 is the most recent release on maven
           central repository. I knew there was 2.0.5 available on
           atlassian's public repository but I don't like adding 3rd
           party repositories if I really don't have to. Wish dwr
           releases were published on maven central as part of the
           release process. Nevertheless, I've just added atlassian
           public repo, will try how things work with 2.0.5.

           Isn't dwr call response handled by dwr javascript and not
           directly by the browser? I assume if it was handled
           directly by the browser that it would result in actual
           redirect.

           Regards,
           Stevo.

           On Wed, Oct 7, 2009 at 12:55 AM, David Marginian
           <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

              If the filter is redirecting to the login page why do
           you need
              setTextHtmlHandler?


              On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
              <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

                  First off, I believe there were some issues with
                  setTextHtmlHandler in earlier versions of DWR 2.x.
           So I would
                  recommend updating to the latest release 2.0.5.

                  Secondly, if the filter is intercepting the request
           why don't
                  you have the filter handle redirecting the user to
           the login
                  page?


                  On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
                  <sslavic@... <mailto:sslavic@...>
           <mailto:sslavic@... <mailto:sslavic@...>>> wrote:


                      Apologies for resurrecting this old topic but I
           couldn't
                      find straight answer
                      neither elsewhere nor in this topic so far. Can
           someone
                      please explain how
                      come that adding e.g.

                      <script type="text/javascript">
                      dwr.engine.setTextHtmlHandler(function() {
                      document.location = 'login.htm';
                      });
                      </script>

                      isn't enough in following case:
                      - Spring security filter chain is configured in
           web.xml
                      before dwr servlet
                      mapping to filter all requests (/*) so
           including requests
                      to /dwr/*;
                      - after Spring security identifies that session has
                      expired (so security
                      context too), since it's been configured to
           enforce that
                      only authenticated
                      user of given role can make dwr calls, it
           responds with
                      redirect to login
                      page;
                      - thus request never makes it to the dwr servlet.

                      Question is how come that that redirect
           response isn't
                      treated as candidate
                      for handling by function assigned as
                      dwr.engine.textHtmlHandler? Should some
                      other handler method be overridden instead in
           this case?

                      Thanks in advance!

                      Regards,
                      Stevo.



                      XMaNIaC wrote:
                      >
                      > Interesting post, just one consideration, in
           the end
                      <dwr:global-filter />
                      > was discarded and global filters are declared
           using the
                      same syntax as
                      > local
                      > ones (but outside a bean definition scope).
                      >
                      > And that makes me wonder what happened to
           @GlobalFilter
                      in the process..I
                      > have to check and update the ticket
                      >
                      > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
                      <xeus_man@... <mailto:xeus_man@...>
           <mailto:xeus_man@... <mailto:xeus_man@...>>>

           wrote:
                      >
                      >>
                      >>
                      >> Try the following link, you need to write an
           ajax
                      filter. And there is no
                      >> need for setTextHtmlHandler, you can throw
           an exception
                      as usual.
                      >>
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                      >>
                      >>
                      >> tlteoh wrote:
                      >> >
                      >> > DWR Version: v2.0.2
                      >> > Tomcat: v5.5
                      >> >
                      >> > I had been searching in the internet long
           time and
                      still can't find out
                      >> > the usage of the setTextHtmlHandler. Below
           is my code
                      in my jsp file
                      >> > inside the <head> section.
                      >> >
                      >> > <script type="text/javascript">
                      >> > dwr.engine.setTextHtmlHandler(function() {
                      >> > alert("Session time out!!!");
                      >> > });
                      >> > </script>
                      >> >
                      >> > Then, inside my web.xml, I define my
           session time out
                      for 1 minute.
                      >> >
                      >> > <session-config>
                      >> > <session-timeout>1</session-timeout>
                      >> > </session-config>
                      >> >
                      >> > After that, I start my tomcat 5.5 and
           access this jsp
                      page. Wait for
                      >> very
                      >> > long, the setTextHtmlHandler function
           never call at
                      all. Is there
                      >> > something I had done wrong?
                      >> >
                      >> > Thanks,
                      >> > Teoh
                      >> >
                      >>
                      >> --
                      >> View this message in context:
                      >>
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
                      >> Sent from the DWR - Users mailing list
           archive at
                      Nabble.com.
                      >>
                      >>
                      >>
                                ---------------------------------------------------------------------
                      >> To unsubscribe, e-mail:
                      users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      >> For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>

                      >>
                      >>
                      >
                      >

                      --
                      View this message in context:
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
                      Sent from the DWR - Users mailing list archive
           at Nabble.com.


                                ---------------------------------------------------------------------
                      To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>







       __________ Information from ESET NOD32 Antivirus, version of
       virus signature database 4484 (20091006) __________

       The message was checked by ESET NOD32 Antivirus.

       http://www.eset.com




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






__________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________


The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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




Re: dwr.engine.setTextHtmlHandler not working

by Stevo Slavic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Issue created, all interested parties, please vote here.

Regards,
Stevo.

On Wed, Oct 7, 2009 at 9:24 AM, Stevo Slavić <sslavic@...> wrote:
Since it was said that only 200 OK response with non empty content is handled via textHtmlHandler, answer is then surely that 302 redirect will not get handled by textHtmlHandler even after release with fix to DWR-337 is made. I'll create a feature request. I guess it will be better if an additional, redirectHandler, is added so that if one needs special handling of redirects (different than with textHtmlHandler) it would be possible, while one could assign same handler function for both handlers if same behavior is needed.

Regards,
Stevo.


On Wed, Oct 7, 2009 at 9:05 AM, Stevo Slavić <sslavic@...> wrote:
Will, with this bug fix, DWR handle redirect response using textHtmlHandler or is additional improvement request needed?

Regards,
Stevo.


On Wed, Oct 7, 2009 at 3:45 AM, David Marginian <david@...> wrote:
We have been talking about it, but this fix is in trunk - we will have to merge it down.  I would recommend using the warningHandler because it may be awhile if we do push out a 2.0.6.

Stevo Slavić wrote:
Debugged on Safari, it seems I'm hit by http://bugs.directwebremoting.org/bugs/browse/DWR-337 - by the fix version(s) I guess there won't be dwr 2.0.6 release

Regards,
Stevo.

On Wed, Oct 7, 2009 at 2:44 AM, Stevo Slavić <sslavic@... <mailto:sslavic@...>> wrote:

   Using 2.0.5 didn't change anything. For redirect statusCode is 302
   so textHtmlHandler won't get called, but something else does seem
   to be called. Can not debug javascript at the moment, Firebug
   doesn't seem to work with FF 3.5.3, so I went to use Temper Data
   FF addon, and it interestingly logged dwr method call POST
   request, redirect to login page response, and then GET request to
   correct login form URL (which I'm not yet sure what triggered) and
   200 OK response to that GET - problem is that the browser URL
   doesn't change nor anything else happens with current page
   content, as if there was no login page URL request/response. I
   assume that dwr's javascript somehow makes that mysterious request
   to login page as response to redirect response it receives, it
   (dwr) receives login page content response (that second logged
   response, with 200 OK status) and doesn't do anything with it.

   Regards,
   Stevo.


   On Wed, Oct 7, 2009 at 2:14 AM, David Marginian
   <david@... <mailto:david@...>> wrote:

       In order for the textHtmlHandler to be called the response has
       to have content, the statusCode has to be 200, and the
       contentType of the response has to be text/html. You can debug
       through engine.js using firebug and quickly see where the
       problem is.

       Stevo Slavić wrote:

           I was using dwr 2.0.3 since I'm using maven for dependency
           management and 2.0.3 is the most recent release on maven
           central repository. I knew there was 2.0.5 available on
           atlassian's public repository but I don't like adding 3rd
           party repositories if I really don't have to. Wish dwr
           releases were published on maven central as part of the
           release process. Nevertheless, I've just added atlassian
           public repo, will try how things work with 2.0.5.

           Isn't dwr call response handled by dwr javascript and not
           directly by the browser? I assume if it was handled
           directly by the browser that it would result in actual
           redirect.

           Regards,
           Stevo.

           On Wed, Oct 7, 2009 at 12:55 AM, David Marginian
           <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

              If the filter is redirecting to the login page why do
           you need
              setTextHtmlHandler?


              On Tue, Oct 6, 2009 at 4:49 PM, David Marginian
              <david@... <mailto:david@...>
           <mailto:david@... <mailto:david@...>>>

           wrote:

                  First off, I believe there were some issues with
                  setTextHtmlHandler in earlier versions of DWR 2.x.
           So I would
                  recommend updating to the latest release 2.0.5.

                  Secondly, if the filter is intercepting the request
           why don't
                  you have the filter handle redirecting the user to
           the login
                  page?


                  On Tue, Oct 6, 2009 at 4:40 PM, Stevo Slavic
                  <sslavic@... <mailto:sslavic@...>
           <mailto:sslavic@... <mailto:sslavic@...>>> wrote:


                      Apologies for resurrecting this old topic but I
           couldn't
                      find straight answer
                      neither elsewhere nor in this topic so far. Can
           someone
                      please explain how
                      come that adding e.g.

                      <script type="text/javascript">
                      dwr.engine.setTextHtmlHandler(function() {
                      document.location = 'login.htm';
                      });
                      </script>

                      isn't enough in following case:
                      - Spring security filter chain is configured in
           web.xml
                      before dwr servlet
                      mapping to filter all requests (/*) so
           including requests
                      to /dwr/*;
                      - after Spring security identifies that session has
                      expired (so security
                      context too), since it's been configured to
           enforce that
                      only authenticated
                      user of given role can make dwr calls, it
           responds with
                      redirect to login
                      page;
                      - thus request never makes it to the dwr servlet.

                      Question is how come that that redirect
           response isn't
                      treated as candidate
                      for handling by function assigned as
                      dwr.engine.textHtmlHandler? Should some
                      other handler method be overridden instead in
           this case?

                      Thanks in advance!

                      Regards,
                      Stevo.



                      XMaNIaC wrote:
                      >
                      > Interesting post, just one consideration, in
           the end
                      <dwr:global-filter />
                      > was discarded and global filters are declared
           using the
                      same syntax as
                      > local
                      > ones (but outside a bean definition scope).
                      >
                      > And that makes me wonder what happened to
           @GlobalFilter
                      in the process..I
                      > have to check and update the ticket
                      >
                      > On Tue, Mar 31, 2009 at 7:18 PM, xeusman
                      <xeus_man@... <mailto:xeus_man@...>
           <mailto:xeus_man@... <mailto:xeus_man@...>>>

           wrote:
                      >
                      >>
                      >>
                      >> Try the following link, you need to write an
           ajax
                      filter. And there is no
                      >> need for setTextHtmlHandler, you can throw
           an exception
                      as usual.
                      >>
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                                http://terrajava.blogspot.com/2009/03/handling-dwr-session-timeouts.html
                      >>
                      >>
                      >>
                      >> tlteoh wrote:
                      >> >
                      >> > DWR Version: v2.0.2
                      >> > Tomcat: v5.5
                      >> >
                      >> > I had been searching in the internet long
           time and
                      still can't find out
                      >> > the usage of the setTextHtmlHandler. Below
           is my code
                      in my jsp file
                      >> > inside the <head> section.
                      >> >
                      >> > <script type="text/javascript">
                      >> > dwr.engine.setTextHtmlHandler(function() {
                      >> > alert("Session time out!!!");
                      >> > });
                      >> > </script>
                      >> >
                      >> > Then, inside my web.xml, I define my
           session time out
                      for 1 minute.
                      >> >
                      >> > <session-config>
                      >> > <session-timeout>1</session-timeout>
                      >> > </session-config>
                      >> >
                      >> > After that, I start my tomcat 5.5 and
           access this jsp
                      page. Wait for
                      >> very
                      >> > long, the setTextHtmlHandler function
           never call at
                      all. Is there
                      >> > something I had done wrong?
                      >> >
                      >> > Thanks,
                      >> > Teoh
                      >> >
                      >>
                      >> --
                      >> View this message in context:
                      >>
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p22805240.html
                      >> Sent from the DWR - Users mailing list
           archive at
                      Nabble.com.
                      >>
                      >>
                      >>
                                ---------------------------------------------------------------------
                      >> To unsubscribe, e-mail:
                      users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      >> For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>

                      >>
                      >>
                      >
                      >

                      --
                      View this message in context:
                                http://www.nabble.com/dwr.engine.setTextHtmlHandler-not-working-tp15516735p25777755.html
                      Sent from the DWR - Users mailing list archive
           at Nabble.com.


                                ---------------------------------------------------------------------
                      To unsubscribe, e-mail:
           users-unsubscribe@...
           <mailto:users-unsubscribe@...>
                      <mailto:users-unsubscribe@...
           <mailto:users-unsubscribe@...>>

                      For additional commands, e-mail:
                      users-help@...
           <mailto:users-help@...>
                      <mailto:users-help@...
           <mailto:users-help@...>>







       __________ Information from ESET NOD32 Antivirus, version of
       virus signature database 4484 (20091006) __________

       The message was checked by ESET NOD32 Antivirus.

       http://www.eset.com




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






__________ Information from ESET NOD32 Antivirus, version of virus signature database 4485 (20091006) __________


The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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