January 30th, 2003, 10:27 AM
java based chat
hello to all!
i've built a chat using php/mysql but i have one problem:
- in order to display new messages i have to keep refreshing the page, wich is something very annoying!
i want to know if it's possible to use a java servlet so i don't have to keep refreshing the page.
(if possible i'd like to keep the php code, i only want to display a message when a user posts one without having to refresh it)
January 30th, 2003, 01:51 PM
A Servlet works exactly like a php script in this case - it only answers requests. It cannot 'push' data to the client. The only way you could do this with java is to create your client side using an applet instead of displayed as html. Then you would have some choices as to how to refresh the client without client intervention. Hope that helps.
February 3rd, 2003, 03:44 AM
u may take a look at hotscripts.com to find some chat scripts that have already solved the problem, too. personally i would avoid using an applet.
March 10th, 2003, 02:54 PM
thanks to both of you! sorry for taking so long to reply.
i have solved the problem with an applet (thanks neli) because it was the only way to avoid keep refreshing the page!
if somebody as another better idea i'll be glad to hear.