• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How client and admin in jsf application can communicate each other

 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I am new to jsf, In my project I have two modules one is client module and the other one is administrator module . My requirement is that when client logged in one browser and admin logged in another browser they both need to communicate each other. For example if client submitted any information to admin a datatable on admin side should update and vice versa...(I am using jsf with rich faces)

if any solution i will be very thankful to you.... guys...
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When working with any web application in any platform in any language, one rule remains the same. The server software does not run users as processes, it accepts user requests, processes them, and returns results on a one-to-one request-to-result basis.

Because of this, you cannot do software-to-software communications, since the software is only running for the duration of the request/response process. Instead, the respective request processors must use shared storage resources to communicate.

One such resource is an application-scope attribute, which in JSF would be a backing bean with the "applicationscoped" characteristic. Another such resource might be a record in persistent storage.

Any time, however, that you have modification of shared data, regardless of what mechanism you use, it is your responsibility to make the modification and access thread-safe. Failure to do so will have unpredictable results.
 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:When working with any web application in any platform in any language, one rule remains the same. The server software does not run users as processes, it accepts user requests, processes them, and returns results on a one-to-one request-to-result basis.

Because of this, you cannot do software-to-software communications, since the software is only running for the duration of the request/response process. Instead, the respective request processors must use shared storage resources to communicate.

One such resource is an application-scope attribute, which in JSF would be a backing bean with the "applicationscoped" characteristic. Another such resource might be a record in persistent storage.

Any time, however, that you have modification of shared data, regardless of what mechanism you use, it is your responsibility to make the modification and access thread-safe. Failure to do so will have unpredictable results.


I have goggled some sites to solve my problem they explained about polling but i didn't understand. Can you let me know what is polling and is it a solution for my problem.?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Polling is the act of periodically querying a server. Because HTTP does not permit unsolicited responses, a request has to be made from the client for each desired response.

The easiest way to do this is to put an HTML refresh META tag in the page that you want to update and define a polling interval value. Once the interval has expired, the client (browser) will re-issue the URL request in order to get an updated copy of the page.

Doing that replaces the entire webpage, though, which can be visually undesirable, so some apps use AJAX to do polled partial-page updates instead. Some of the extension tag libraries provide special "poll" tags to make that easier. RichFaces is one of them.
 
krishna neerukonda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Polling is the act of periodically querying a server. Because HTTP does not permit unsolicited responses, a request has to be made from the client for each desired response.

The easiest way to do this is to put an HTML refresh META tag in the page that you want to update and define a polling interval value. Once the interval has expired, the client (browser) will re-issue the URL request in order to get an updated copy of the page.

Doing that replaces the entire webpage, though, which can be visually undesirable, so some apps use AJAX to do polled partial-page updates instead. Some of the extension tag libraries provide special "poll" tags to make that easier. RichFaces is one of them.


Thank you for explaining about poling. Is it possible to refresh particular client(browser) periodically from server basing on session.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like I said, the server cannot volunteer anything. Only the client can request. The best that the server can do is provide the information that the client uses (such as the page refresh META element).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic