aspose file tools*
The moose likes Struts and the fly likes How to push data from server to client in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to push data from server to client in struts" Watch "How to push data from server to client in struts" New topic
Author

How to push data from server to client in struts

Nagendra Siram
Greenhorn

Joined: Nov 18, 2009
Posts: 4
I have to send data to client from server without client knowledge(no request from client to be made). If two users are using the application. If User1 changes data, User2 should be notified automatically. how can i do with struts? please help
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

HTTP protocol doesn't support push. The client has to pull the data from the server. So you'll have to make calls (normally ajax calls) to the server at regular intervals...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Nagendra Siram
Greenhorn

Joined: Nov 18, 2009
Posts: 4
Thanks for info. A small query, so you mean there is no way to do this in struts. and how are chat applications implemented in struts
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9313
    
  17

There's no way of pushing data in HTTP, so neither can struts do anything about it, nor can JavaEE. All chat applications make ajax requests to the server at regular intervals to a specific service on the server which sends any new chats as a response...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to push data from server to client in struts