Thread: java based chat

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0

    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)

    thanks!
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    europe
    Posts
    287
    Rep Power
    13
    i guess u can achieve that easiest way using javascript. but the screen will flicker a bit.
    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.
    cheers, jens
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    6
    Rep Power
    0

    thanks


    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.

IMN logo majestic logo threadwatch logo seochat tools logo