Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-13-2011, 01:56 PM   PM User | #1
alex.p
New to the CF scene

 
Join Date: Dec 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
alex.p is an unknown quantity at this point
MVC in Ajax

Was wondering how you implement MVC easily using Ajax. I have a backend servlet that does processing and acts as the controller but I want the frontend to be html/javascript/jsp and receive updates from the controller as a view. For example if one client updates the view the servlet controller will process the event and update the view for all other clients which are looking at the same view. This becomes a problem because the servlet can only react to http requests and if the controller wants to update the frontend at a random point in time it can't. Is there a way to listen to events on the backend using the frontend Javascript - to me it seems unlikely as it would have to establish a TCP connection at any point in time to the client but how would this be done normally? Essentially I want to be able to update html elements on a page depending on some remote event? Ideally I don't want to keep polling the servlet with requests.

Thanks for the help.
alex.p is offline   Reply With Quote
Old 12-13-2011, 02:33 PM   PM User | #2
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 810
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
Quote:
Originally Posted by alex.p View Post
Essentially I want to be able to update html elements on a page depending on some remote event? Ideally I don't want to keep polling the servlet with requests.

Thanks for the help.
http://en.wikipedia.org/wiki/WebSocket
DaveyErwin is offline   Reply With Quote
Users who have thanked DaveyErwin for this post:
alex.p (12-13-2011)
Old 12-13-2011, 02:44 PM   PM User | #3
alex.p
New to the CF scene

 
Join Date: Dec 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
alex.p is an unknown quantity at this point
Thanks definitely look into that . Hmm do you know of any frameworks that wrap around WebSockets as it seems quite low level I'm guessing there won't be too many as it's still a work in progress but just thinking if there's easy object support and Java integration.
alex.p is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:34 AM.


Advertisement
Log in to turn off these ads.