TheOnlyIdiot
TheOnlyIdiot

Reputation: 1202

java tomcat6 - How to automatically refresh page when a data is added?

first of all let me explain what Im tring to do. Im trying to create a very simple web based chat program. In my development I have 2 pcs using only 1 ip address. The ip address that is being used is the ip address which runs the tomcat6 server. The simple chat is connected to the database. How will I make the web page automatically update when the other pc input data(message) in the database without reloading the page.

Please forgive me if my question might sound idiotic. I have no experience in chat program. Please help.

Upvotes: 0

Views: 673

Answers (3)

Konza
Konza

Reputation: 2173

You can try webSockets. Its a new feature in html5. It allows you to do full duplex communication. Its very simple. You will have to do both client side and server side. For doing the server side you will need tomcat 7.0.32. It contains a new WebSocketServlet. These links may help you..

http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html

http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/websocket/

http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/

Upvotes: 1

epoch
epoch

Reputation: 16615

Technologies you may want to check out:

Upvotes: 1

ravindra
ravindra

Reputation: 186

What are the web technologies using there. If you are using JSF You can use AJAX Push feature from icefaces. you can read more from this link. http://www.icesoft.org/java/projects/ICEfaces/ajax-push.jsf

Upvotes: 1

Related Questions