supporting comet for certain URL's

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

supporting comet for certain URL's

Darrell Esau-2
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Mike Wilson
Administrator
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Darrell Esau-2
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Mike Wilson
Administrator
Ok, so there are certainly several ways of doing this, but I'm thinking this might be the simplest: configure two DWR servlets in your web.xml, one configured for polling and one for comet. Then choose the desired one when including DWR into the different pages.
 
Best regards
Mike
 
Darrell Esau wrote:
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Darrell Esau-2
Erm... not sure I completely understand.

Are you saying this:

Add another <servlet> entry, pointed at the same servlet-class (org.directwebremoting.servlet.DwrServlet), then add another servlet-mapping with a different url-pattern, perhaps:

<url-pattern>/comet-dwr/*</url-pattern>

Then -- when I include engine, do this:

<script src="comet-dwr/engine.js"/>

And -- when including my remoted classes:
/comet-dwr/interface/MyExportedClass.js

-d


On Wed, Feb 8, 2012 at 12:09 PM, Mike Wilson <[hidden email]> wrote:
Ok, so there are certainly several ways of doing this, but I'm thinking this might be the simplest: configure two DWR servlets in your web.xml, one configured for polling and one for comet. Then choose the desired one when including DWR into the different pages.
 
Best regards
Mike
 
Darrell Esau wrote:
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

david@butterdev.com
Yes.

On Wed, Feb 8, 2012 at 1:23 PM, Darrell Esau <[hidden email]> wrote:
Erm... not sure I completely understand.

Are you saying this:

Add another <servlet> entry, pointed at the same servlet-class (org.directwebremoting.servlet.DwrServlet), then add another servlet-mapping with a different url-pattern, perhaps:

<url-pattern>/comet-dwr/*</url-pattern>

Then -- when I include engine, do this:

<script src="comet-dwr/engine.js"/>

And -- when including my remoted classes:
/comet-dwr/interface/MyExportedClass.js

-d


On Wed, Feb 8, 2012 at 12:09 PM, Mike Wilson <[hidden email]> wrote:
Ok, so there are certainly several ways of doing this, but I'm thinking this might be the simplest: configure two DWR servlets in your web.xml, one configured for polling and one for comet. Then choose the desired one when including DWR into the different pages.
 
Best regards
Mike
 
Darrell Esau wrote:
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Darrell Esau-2
Awesome - thanks Mike!

-d


On Wed, Feb 8, 2012 at 12:26 PM, David Marginian <[hidden email]> wrote:
Yes.


On Wed, Feb 8, 2012 at 1:23 PM, Darrell Esau <[hidden email]> wrote:
Erm... not sure I completely understand.

Are you saying this:

Add another <servlet> entry, pointed at the same servlet-class (org.directwebremoting.servlet.DwrServlet), then add another servlet-mapping with a different url-pattern, perhaps:

<url-pattern>/comet-dwr/*</url-pattern>

Then -- when I include engine, do this:

<script src="comet-dwr/engine.js"/>

And -- when including my remoted classes:
/comet-dwr/interface/MyExportedClass.js

-d


On Wed, Feb 8, 2012 at 12:09 PM, Mike Wilson <[hidden email]> wrote:
Ok, so there are certainly several ways of doing this, but I'm thinking this might be the simplest: configure two DWR servlets in your web.xml, one configured for polling and one for comet. Then choose the desired one when including DWR into the different pages.
 
Best regards
Mike
 
Darrell Esau wrote:
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: supporting comet for certain URL's

Darrell Esau-2
... and David  :)



On Wed, Feb 8, 2012 at 12:35 PM, Darrell Esau <[hidden email]> wrote:
Awesome - thanks Mike!

-d


On Wed, Feb 8, 2012 at 12:26 PM, David Marginian <[hidden email]> wrote:
Yes.


On Wed, Feb 8, 2012 at 1:23 PM, Darrell Esau <[hidden email]> wrote:
Erm... not sure I completely understand.

Are you saying this:

Add another <servlet> entry, pointed at the same servlet-class (org.directwebremoting.servlet.DwrServlet), then add another servlet-mapping with a different url-pattern, perhaps:

<url-pattern>/comet-dwr/*</url-pattern>

Then -- when I include engine, do this:

<script src="comet-dwr/engine.js"/>

And -- when including my remoted classes:
/comet-dwr/interface/MyExportedClass.js

-d


On Wed, Feb 8, 2012 at 12:09 PM, Mike Wilson <[hidden email]> wrote:
Ok, so there are certainly several ways of doing this, but I'm thinking this might be the simplest: configure two DWR servlets in your web.xml, one configured for polling and one for comet. Then choose the desired one when including DWR into the different pages.
 
Best regards
Mike
 
Darrell Esau wrote:
So -- we've got a big webapp using DWR for all kinds of stuff, including server-originated events being pushed down to clients via reverse ajax (currently only polling).  A couple years ago (using DWR 2), we tried comet, but ran into a number of problems (mostly with Safari running out of connections).. and polling is good enough, so we just stuck with that.

Now, however, we're adding some mobile capabilities and we want to have immediate notification for some events.  For this, comet would seem to fit perfectly, and I want to use my existing client notification system -- but I want for comet to be enabled only for certain clients (clients on certain URLs).

For instance, if most of my users are on:
/MyApp/HomePage

I want those users to be getting normal polling for reverse ajax.

However, when a client navigates to:
/MyApp/MobilePage

I want those clients to start using comet instead of polling.

Doable?

Or should I just bite the bullet and switch everything to comet?

-d


On Wed, Feb 8, 2012 at 11:53 AM, Mike Wilson <[hidden email]> wrote:
Hi Darrell,
Can you tell us a bit more about what you want to do? I'm not sure what you mean with a specific set of URLs?
Best regards
Mike Wilson
 
Darrell Esau wrote:
Hi all,

Using DWR 3.0rc2

I've got reverse ajax all setup and working fine, using polling only.

I'm wondering if it's possible to enable DWR to use comet for only a specific set of URL(s).

I'm looking at the ServerLoadMonitor interface, which seems to be the way to go, however I don't see any way of detecting the client's URL from this interface.

Any ideas?

Thanks!
-d






Loading...