This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes how servlets come to role Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how servlets come to role" Watch "how servlets come to role" New topic

how servlets come to role

Monarch Bhojani
Ranch Hand

Joined: Feb 27, 2005
Posts: 46
hello all
I am making a chat application in JAVA. It uses JSP form to login via the servlet against the database.

Now when the user is authenticated and his name is authorized to do the chat his name should be maintained within the LDAP

That is the name while it is registered is passed on to the LDAP directory where it remains untill he is chatting and when he logs out his name should be deleted from the directory
It is done to reduce the load on the server side

Can it be done?
If it can be then how should i pass the entry of the person from the databse viz servlet or anything you suggest should pass the name to LDAP (How to populate the directory) and how will the entry be maintained and deleted when the user logs out
I have posted this question many a times to EJb and security forums but I am not getting any replies

Plz help me I am trying to do this since a month but not getting idea as to how to proceed

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Actually its not a good idea to develop a chat application over servlets. Hence, http is a stateless protocol. If you want a chat app in browser better go for applet + socket programming. You can also go for javaspaces.

Anyhow, you can use HttpSessionListener to track the users' logout.

By the way, how are you sending messages to recepients? I think the recepient should query the server after sometimes to check if there is something for me.
Monarch Bhojani
Ranch Hand

Joined: Feb 27, 2005
Posts: 46
Thanks for ur reply
Actually my application is going to be used over the internet or a company level network so socket according to me is not possible for me

Another thing that we hae put in such a combination that we dont require the stream operations
and its running well too but the thing is the usernames are maintained into the arrays
but the same names should be maintained in the LDAP
as there would be less load the server side

what should be the exact procedure to do that

I agree. Here's the link:
subject: how servlets come to role
It's not a secret anymore!