0

There are number of users logged in to servlet. How to send data to specific logged in user from servlet without any HTTP request from the logged in user. Which approach i should follow. Admin once logged in to servlet can see number of users with their log in details. Now admin will select one user and will post data to that user how this can be achieved.

Thanks

user1537457
  • 109
  • 2
  • 9

1 Answers1

0

No matter how many users are logged in, they can be served with only one HTTP request and one servlet. The number of users logged in has no relation with no. of servlets or jsp's. I think your question is not specific, please be more clear on the question.

Ashish Nagar
  • 41
  • 1
  • 3
  • @ Ashish Nagar We have one servlet first one user send login HTTP req and gets login success response from servlet now session for this user is started.Similarly other user logs in. Now admin can see two users user1 and user2. Admin will select one user and send some data to that user. Servlet should push data to that user at any time during session without users HTTP request. kindly note during session user won't send any other HTTP request. Hope now u get what is my requirement. – user1537457 Oct 26 '12 at 07:23
  • What I understood is there is a login page which validates the user and redirects to some welcome page. Admin which is again a user, can see which users are logged in on some page. If that so, u can access the user information including the credentials of the user as per the design by selecting the user. Which servlet should push data to user? what is the component you are referring as user here? More clear would be if you can post your code snippet here. – Ashish Nagar Oct 26 '12 at 08:33
  • @ Ashish Admin will also login to that servlet and all logged in users will be shown in one dropdown control also other dropdown will have data which comes from database. Now here admin will select one user from first drop down and from second dropdown will select one data entry and at last will click send button. On send button action that data should be displayed to user. Hope this will give you clear picture. – user1537457 Oct 26 '12 at 14:14
  • As per normal servlet operations there is one HTTP request and to that request there is one HTTP response. This is done for login. Now there won't be HTTP request. So question is without HTTP request how to post data to that user. – user1537457 Oct 26 '12 at 14:32
  • Take a look at this: [comet](http://en.wikipedia.org/wiki/Comet_%28programming%29) and [cometd](http://cometd.org) – Alper Akture Oct 27 '12 at 05:50